Skip to content

Commit

Permalink
feat: Upgrade typeorm for separate sqlite read & write connections
Browse files Browse the repository at this point in the history
Upgrade @n8n/typeorm to the latest version. The latest version changes the
pooling mechanism of SQLite to use a single write connection and a pool
of read connections.
  • Loading branch information
tomi committed Apr 26, 2024
1 parent b694e77 commit ca8543c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"@n8n/localtunnel": "2.1.0",
"@n8n/n8n-nodes-langchain": "workspace:*",
"@n8n/permissions": "workspace:*",
"@n8n/typeorm": "0.3.20-8",
"@n8n/typeorm": "0.3.20-9",
"@n8n_io/license-sdk": "2.10.0",
"@oclif/core": "3.18.1",
"@rudderstack/rudder-sdk-node": "2.0.7",
Expand Down
9 changes: 8 additions & 1 deletion packages/cli/src/databases/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ const getSqliteConnectionOptions = (): SqliteConnectionOptions | SqlitePooledCon
migrations: sqliteMigrations,
};
if (poolSize > 0) {
return { type: 'sqlite-pooled', poolSize, enableWAL: true, ...commonOptions };
return {
type: 'sqlite-pooled',
poolSize,
enableWAL: true,
acquireTimeout: 60_000,
destroyTimeout: 5_000,
...commonOptions,
};
} else {
return {
type: 'sqlite',
Expand Down
33 changes: 17 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca8543c

Please sign in to comment.