From 43f129c17465f711ddb377e403c4b095ef405aac Mon Sep 17 00:00:00 2001 From: mphill Date: Mon, 19 Jun 2023 19:26:15 -0500 Subject: [PATCH] Use sqlite_master instead of sqlite_schema so versions of sqlite prior to 3.33.0 work There is a mismatch in the schema name being used in the inspector, in one query sqlite_schema is used, then directly after sqlite_master is used. They renamed sqlite_master to sqlite_schema, but both exist at this point and will for the foreseeable future. --- src/dialect/sqlite/sqlite-introspector.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dialect/sqlite/sqlite-introspector.ts b/src/dialect/sqlite/sqlite-introspector.ts index c2ccf358c..e86cfa67a 100644 --- a/src/dialect/sqlite/sqlite-introspector.ts +++ b/src/dialect/sqlite/sqlite-introspector.ts @@ -28,7 +28,7 @@ export class SqliteIntrospector implements DatabaseIntrospector { options: DatabaseMetadataOptions = { withInternalKyselyTables: false } ): Promise { let query = this.#db - .selectFrom('sqlite_schema') + .selectFrom('sqlite_master') .where('type', 'in', ['table', 'view']) .where('name', 'not like', 'sqlite_%') .select('name')