{"record":{"id":"ec68882146bb42c3","repo":"n8n-io/n8n","slug":"this-driver-does-not-support-table-schemas","errorCode":null,"errorMessage":"This driver does not support table schemas","messagePattern":"This driver does not support table schemas","errorType":"exception","errorClass":"TypeORMError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/typeorm/src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts","lineNumber":205,"sourceCode":"\t/**\n\t * Checks if database with the given name exist.\n\t */\n\tasync hasDatabase(database: string): Promise<boolean> {\n\t\treturn Promise.resolve(false);\n\t}\n\n\t/**\n\t * Loads currently using database\n\t */\n\tasync getCurrentDatabase(): Promise<undefined> {\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\t/**\n\t * Checks if schema with the given name exist.\n\t */\n\tasync hasSchema(schema: string): Promise<boolean> {\n\t\tthrow new TypeORMError(`This driver does not support table schemas`);\n\t}\n\n\t/**\n\t * Loads currently using database schema\n\t */\n\tasync getCurrentSchema(): Promise<undefined> {\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\t/**\n\t * Checks if table with the given name exist in the database.\n\t */\n\tasync hasTable(tableOrName: Table | string): Promise<boolean> {\n\t\tconst tableName = InstanceChecker.isTable(tableOrName) ? tableOrName.name : tableOrName;\n\t\tconst sql = `SELECT * FROM \"sqlite_master\" WHERE \"type\" = 'table' AND \"name\" = ?1`;\n\t\tconst result = await this.query(sql, [tableName]);\n\t\treturn result.length ? true : false;\n\t}","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/typeorm/src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts#L187-L223","documentation":"SQLite has no schema namespace concept (unlike PostgreSQL), so AbstractSqliteQueryRunner.hasSchema() always throws TypeORMError. Schema-level introspection is simply not part of this driver's surface.","triggerScenarios":"Calling queryRunner.hasSchema(name) on a SQLite DataSource.","commonSituations":"Cross-database introspection/migration code that checks schemas, entities declaring a `schema` option, or tooling assuming Postgres semantics ported to SQLite.","solutions":["Remove schema checks/logic for SQLite — entities should not set `schema`.","Guard the call behind a driver-type check.","If you need logical separation in SQLite, use separate database files or table-name prefixes instead of schemas."],"exampleFix":"// before\nconst exists = await queryRunner.hasSchema('public');\n\n// after\nconst exists = dataSource.options.type === 'sqlite' || dataSource.options.type === 'sqlite-pooled'\n  ? true // no schema concept\n  : await queryRunner.hasSchema('public');","handlingStrategy":"type-guard","validationCode":"function supportsSchemas(ds: DataSource): boolean {\n  const t = ds.options.type;\n  return t !== 'sqlite' && t !== 'sqlite-pooled' && t !== 'better-sqlite3';\n}\n\nconst exists = supportsSchemas(dataSource) ? await queryRunner.hasSchema('public') : true;","typeGuard":"const driverSupportsSchemas = (ds: DataSource): boolean =>\n  ds.options.type !== 'sqlite' &&\n  ds.options.type !== 'sqlite-pooled' &&\n  ds.options.type !== 'better-sqlite3';","tryCatchPattern":null,"preventionTips":["Don't set `schema` on entities used with SQLite.","Centralize schema-aware logic behind a driver-type check.","Treat SQLite as a single-namespace store."],"tags":["database","sqlite","schema"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}