{"record":{"id":"d109082f51f30146","repo":"n8n-io/n8n","slug":"transactions-aren-t-supported-by-this-connection","errorCode":null,"errorMessage":"Transactions aren't supported by ${this.connection.driver.options.type}.","messagePattern":"Transactions aren't supported by (.+?)\\.","errorType":"exception","errorClass":"TypeORMError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/typeorm/src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts","lineNumber":74,"sourceCode":"\t\treturn Promise.resolve(this.driver.databaseConnection);\n\t}\n\n\t/**\n\t * Releases used database connection.\n\t * We just clear loaded tables and sql in memory, because sqlite do not support multiple connections thus query runners.\n\t */\n\trelease(): Promise<void> {\n\t\tthis.loadedTables = [];\n\t\tthis.clearSqlMemory();\n\t\treturn Promise.resolve();\n\t}\n\n\t/**\n\t * Starts transaction.\n\t */\n\tasync startTransaction(isolationLevel?: IsolationLevel): Promise<void> {\n\t\tif (this.driver.transactionSupport === 'none')\n\t\t\tthrow new TypeORMError(\n\t\t\t\t`Transactions aren't supported by ${this.connection.driver.options.type}.`,\n\t\t\t);\n\n\t\tif (this.isTransactionActive && this.driver.transactionSupport === 'simple')\n\t\t\tthrow new TransactionAlreadyStartedError();\n\n\t\tif (\n\t\t\tisolationLevel &&\n\t\t\tisolationLevel !== 'READ UNCOMMITTED' &&\n\t\t\tisolationLevel !== 'SERIALIZABLE'\n\t\t)\n\t\t\tthrow new TypeORMError(`SQLite only supports SERIALIZABLE and READ UNCOMMITTED isolation`);\n\n\t\tthis.isTransactionActive = true;\n\t\ttry {\n\t\t\tawait this.broadcaster.broadcast('BeforeTransactionStart');\n\t\t} catch (err) {\n\t\t\tthis.isTransactionActive = false;","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/typeorm/src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts#L56-L92","documentation":"TypeORMError('Transactions aren't supported by ${driver.options.type}') is raised in AbstractSqliteQueryRunner.startTransaction when driver.transactionSupport === 'none'. The sqlite (legacy) driver declares transactionSupport as 'none', so any attempt to start a transaction through it fails immediately.","triggerScenarios":"Code calls queryRunner.startTransaction() (or DataSource.transaction()) while the driver is the legacy non-pooled sqlite driver whose transactionSupport is 'none'. The 'sqlite-pooled' driver supports transactions, the plain 'sqlite' driver does not.","commonSituations":"A default local install uses DB_TYPE=sqlite (legacy) but business logic attempts a transactional unit of work; code that worked against postgres is run against sqlite; a library assumes transaction support without checking.","solutions":["Switch the driver to 'sqlite-pooled' (DB_TYPE=sqlite-pooled), which supports transactions and is the recommended local-dev driver.","If you must stay on legacy sqlite, refactor the code to not use explicit transactions (single statements are atomic; multi-statement atomicity is not guaranteed).","Use postgres for any environment where transactional integrity is required.","Check driver.transactionSupport at runtime before calling startTransaction to fail gracefully."],"exampleFix":"// before\nDB_TYPE=sqlite\nawait ds.transaction(async (qr) => { ... });  // fails\n// after\nDB_TYPE=sqlite-pooled\nawait ds.transaction(async (qr) => { ... });\n","handlingStrategy":"validation","validationCode":"const SUPPORTS_TX = new Set(['postgres', 'sqlite-pooled']);\nfunction assertTransactionsSupported(driverType: string): void {\n  if (!SUPPORTS_TX.has(driverType)) {\n    throw new Error(`Driver '${driverType}' does not support transactions; use sqlite-pooled or postgres.`);\n  }\n}\n","typeGuard":"function driverSupportsTransactions(driver: { transactionSupport?: string }): boolean {\n  return driver.transactionSupport !== 'none';\n}\n","tryCatchPattern":"import { TypeORMError } from '@n8n/typeorm';\ntry {\n  await dataSource.transaction(async (qr) => { /* ... */ });\n} catch (e) {\n  if (e instanceof TypeORMError && /Transactions aren't supported/.test(e.message)) {\n    throw new Error('Current driver has no transaction support; switch DB_TYPE to sqlite-pooled or postgres.');\n  }\n  throw e;\n}\n","preventionTips":["Use sqlite-pooled (or postgres) for any environment that needs transactions.","Check driver.transactionSupport before calling startTransaction.","Document that the legacy sqlite driver is non-transactional.","Gate transactional code paths on a feature flag derived from the driver."],"tags":["typeorm","sqlite","transactions","database","config"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}