Skip to content

Commit 055a1f2

Browse files
authored
treat main as the default schema (#291)
1 parent 48c788b commit 055a1f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sqlite.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class SQLiteDatabaseClient {
2929
]);
3030
}
3131
async describeTables({schema} = {}) {
32-
return this.query(`SELECT schema, name FROM pragma_table_list() WHERE type = 'table'${schema == null ? "" : ` AND schema = ?`} AND name NOT LIKE 'sqlite_%'`, schema == null ? [] : [schema]);
32+
return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${schema == null ? "" : ` AND schema = ?`} AND name NOT LIKE 'sqlite_%'`, schema == null ? [] : [schema]);
3333
}
3434
async describeColumns({schema, table} = {}) {
3535
if (table == null) throw new Error(`missing table`);

0 commit comments

Comments
 (0)