mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
feat(core): Add an option to enable WAL mode for SQLite (#7118)
https://www.sqlite.org/wal.html
This commit is contained in:
parent
67aaad15eb
commit
1d1a022def
|
@ -164,6 +164,12 @@ export const schema = {
|
|||
default: 'database.sqlite',
|
||||
env: 'DB_SQLITE_DATABASE',
|
||||
},
|
||||
enableWAL: {
|
||||
doc: 'Enable SQLite WAL mode',
|
||||
format: Boolean,
|
||||
default: false,
|
||||
env: 'DB_SQLITE_ENABLE_WAL',
|
||||
},
|
||||
executeVacuumOnStartup: {
|
||||
doc: 'Runs VACUUM operation on startup to rebuild the database. Reduces filesize and optimizes indexes. WARNING: This is a long running blocking operation. Will increase start-up time.',
|
||||
format: Boolean,
|
||||
|
|
|
@ -24,6 +24,7 @@ const getDBConnectionOptions = (dbType: DatabaseType) => {
|
|||
UserSettings.getUserN8nFolderPath(),
|
||||
config.getEnv('database.sqlite.database'),
|
||||
),
|
||||
enableWAL: config.getEnv('database.sqlite.enableWAL'),
|
||||
}
|
||||
: {
|
||||
database: config.getEnv(`database.${configDBType}.database`),
|
||||
|
|
|
@ -576,7 +576,7 @@ export async function getVariableById(id: string) {
|
|||
* Generate options for an in-memory sqlite database connection,
|
||||
* one per test suite run.
|
||||
*/
|
||||
export const getSqliteOptions = ({ name }: { name: string }): ConnectionOptions => {
|
||||
const getSqliteOptions = ({ name }: { name: string }): ConnectionOptions => {
|
||||
return {
|
||||
name,
|
||||
type: 'sqlite',
|
||||
|
@ -586,6 +586,7 @@ export const getSqliteOptions = ({ name }: { name: string }): ConnectionOptions
|
|||
migrations: sqliteMigrations,
|
||||
migrationsTableName: 'migrations',
|
||||
migrationsRun: false,
|
||||
enableWAL: config.getEnv('database.sqlite.enableWAL'),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue