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 d318c3f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/@n8n/nodes-langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"@langchain/openai": "^0.0.16",
"@langchain/pinecone": "^0.0.3",
"@langchain/redis": "^0.0.2",
"@n8n/typeorm": "0.3.20-8",
"@n8n/typeorm": "0.3.20-9",
"@n8n/vm2": "3.9.20",
"@pinecone-database/pinecone": "2.1.0",
"@qdrant/js-client-rest": "1.7.0",
Expand Down
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
32 changes: 17 additions & 15 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 d318c3f

Please sign in to comment.