mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fix d1 introspect issue by excluding _cf_METADATA
This commit is contained in:
@@ -28,6 +28,10 @@ export class SqliteIntrospector extends BaseIntrospector {
|
||||
}
|
||||
|
||||
async getSchemaSpec() {
|
||||
const ext = this.getExcludedTableNames()
|
||||
.map((it) => `'${it}'`)
|
||||
.join(", ");
|
||||
|
||||
const query = sql`
|
||||
SELECT m.name, m.type, m.sql,
|
||||
(SELECT json_group_array(
|
||||
@@ -56,7 +60,7 @@ export class SqliteIntrospector extends BaseIntrospector {
|
||||
FROM sqlite_master m
|
||||
WHERE m.type IN ('table', 'view')
|
||||
and m.name not like 'sqlite_%'
|
||||
and m.name not in (${this.getExcludedTableNames().join(", ")})
|
||||
and m.name not in (${sql.raw(ext)})
|
||||
`;
|
||||
|
||||
const tables = await this.executeWithPlugins<SqliteSchemaSpec[]>(query);
|
||||
|
||||
Reference in New Issue
Block a user