n8n-io/n8n · error · TypeORMError

This driver does not support table schemas

Error message

This driver does not support table schemas

What it means

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.

Source

Thrown at packages/@n8n/typeorm/src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts:205

	/**
	 * Checks if database with the given name exist.
	 */
	async hasDatabase(database: string): Promise<boolean> {
		return Promise.resolve(false);
	}

	/**
	 * Loads currently using database
	 */
	async getCurrentDatabase(): Promise<undefined> {
		return Promise.resolve(undefined);
	}

	/**
	 * Checks if schema with the given name exist.
	 */
	async hasSchema(schema: string): Promise<boolean> {
		throw new TypeORMError(`This driver does not support table schemas`);
	}

	/**
	 * Loads currently using database schema
	 */
	async getCurrentSchema(): Promise<undefined> {
		return Promise.resolve(undefined);
	}

	/**
	 * Checks if table with the given name exist in the database.
	 */
	async hasTable(tableOrName: Table | string): Promise<boolean> {
		const tableName = InstanceChecker.isTable(tableOrName) ? tableOrName.name : tableOrName;
		const sql = `SELECT * FROM "sqlite_master" WHERE "type" = 'table' AND "name" = ?1`;
		const result = await this.query(sql, [tableName]);
		return result.length ? true : false;
	}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Remove schema checks/logic for SQLite — entities should not set `schema`.
  2. Guard the call behind a driver-type check.
  3. If you need logical separation in SQLite, use separate database files or table-name prefixes instead of schemas.

Example fix

// before
const exists = await queryRunner.hasSchema('public');

// after
const exists = dataSource.options.type === 'sqlite' || dataSource.options.type === 'sqlite-pooled'
  ? true // no schema concept
  : await queryRunner.hasSchema('public');
Defensive patterns

Strategy: type-guard

Validate before calling

function supportsSchemas(ds: DataSource): boolean {
  const t = ds.options.type;
  return t !== 'sqlite' && t !== 'sqlite-pooled' && t !== 'better-sqlite3';
}

const exists = supportsSchemas(dataSource) ? await queryRunner.hasSchema('public') : true;

Type guard

const driverSupportsSchemas = (ds: DataSource): boolean =>
  ds.options.type !== 'sqlite' &&
  ds.options.type !== 'sqlite-pooled' &&
  ds.options.type !== 'better-sqlite3';

Prevention

When it happens

Trigger: Calling queryRunner.hasSchema(name) on a SQLite DataSource.

Common situations: Cross-database introspection/migration code that checks schemas, entities declaring a `schema` option, or tooling assuming Postgres semantics ported to SQLite.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/ec68882146bb42c3. Report an issue: GitHub.