{"record":{"id":"7191bbc223676284","repo":"n8n-io/n8n","slug":"stream-is-not-supported-by-sqlite-driver","errorCode":null,"errorMessage":"Stream is not supported by sqlite driver.","messagePattern":"Stream is not supported by sqlite driver\\.","errorType":"exception","errorClass":"TypeORMError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/typeorm/src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts","lineNumber":169,"sourceCode":"\t\t\t\tthis.isTransactionActive = false;\n\t\t\t}\n\n\t\t\tawait this.broadcaster.broadcast('AfterTransactionRollback');\n\t\t} catch (rollbackError) {\n\t\t\tthrow new TransactionRollbackFailedError(rollbackError);\n\t\t}\n\t}\n\n\t/**\n\t * Returns raw data stream.\n\t */\n\tstream(\n\t\tquery: string,\n\t\tparameters?: any[],\n\t\tonEnd?: Function,\n\t\tonError?: Function,\n\t): Promise<ReadStream> {\n\t\tthrow new TypeORMError(`Stream is not supported by sqlite driver.`);\n\t}\n\n\t/**\n\t * Returns all available database names including system databases.\n\t */\n\tasync getDatabases(): Promise<string[]> {\n\t\treturn Promise.resolve([]);\n\t}\n\n\t/**\n\t * Returns all available schema names including system schemas.\n\t * If database parameter specified, returns schemas of that database.\n\t */\n\tasync getSchemas(database?: string): Promise<string[]> {\n\t\treturn Promise.resolve([]);\n\t}\n\n\t/**","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/typeorm/src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts#L151-L187","documentation":"SQLite's driver has no streaming result-set support, so AbstractSqliteQueryRunner.stream() unconditionally throws TypeORMError the moment it is called. There is no partial capability — it is always a programming error on this driver.","triggerScenarios":"Calling queryRunner.stream(...) (or any DataSource higher-level API that delegates to streaming) against a SQLite-backed DataSource.","commonSituations":"Generic repositories/DAOs written for Postgres that assume stream() works on every driver; large-export features that naively reach for streams; copy-pasted code from a PG project.","solutions":["Do not call stream() on SQLite — use query() and paginate with LIMIT/OFFSET or iterate the returned rows in memory.","Branch on driver type before choosing the streaming path.","For genuinely large SQLite datasets, switch to an incremental cursor or move the data to a streaming-capable store."],"exampleFix":"// before\nawait queryRunner.stream('SELECT * FROM big_table');\n\n// after\nif (queryRunner.stream === undefined || dataSource.options.type === 'sqlite' || dataSource.options.type === 'sqlite-pooled') {\n  const rows = await queryRunner.query('SELECT * FROM big_table LIMIT ? OFFSET ?', [size, offset]);\n} else {\n  await queryRunner.stream('SELECT * FROM big_table');\n}","handlingStrategy":"validation","validationCode":"function supportsStreaming(ds: DataSource): boolean {\n  const t = ds.options.type;\n  return t !== 'sqlite' && t !== 'sqlite-pooled' && t !== 'better-sqlite3';\n}\n\nif (supportsStreaming(dataSource)) {\n  await queryRunner.stream(sql);\n} else {\n  const rows = await queryRunner.query(sql);\n}","typeGuard":"const isSqliteRunner = (qr: QueryRunner): boolean =>\n  qr.connection.options.type === 'sqlite' ||\n  qr.connection.options.type === 'sqlite-pooled';","tryCatchPattern":null,"preventionTips":["Branch query strategy on driver type.","Never assume stream() exists across drivers.","Prefer paginated query() for SQLite exports."],"tags":["database","sqlite","streaming"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}