Skip to content

Commit

Permalink
Merge pull request #467 from curveball/fix-knex-warning
Browse files Browse the repository at this point in the history
Fix knex warning for sqlite3 not supporting default values
  • Loading branch information
evert authored Sep 24, 2023
2 parents 8f812a9 + eec88b4 commit 2a39b85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Changelog
should be no end-user effects to this.
* Added a system group principal , which allows admins to set privileges for
every user in the system.
* Fix Sqlite startup warning.


0.23.1 (2023-03-29)
Expand Down
5 changes: 4 additions & 1 deletion src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export function getSettings(): Knex.Config {
let connection: Knex.MySql2ConnectionConfig | Knex.PgConnectionConfig | Knex.Sqlite3ConnectionConfig;
let client;
let searchPath;
let useNullAsDefault: undefined|true = undefined;

if (process.env.PG_DATABASE) {

Expand Down Expand Up @@ -159,8 +160,9 @@ export function getSettings(): Knex.Config {
}

connection = {
filename: process.env.DB_FILENAME || 'a12nserver.sqlite3'
filename: process.env.DB_FILENAME || 'a12nserver.sqlite3',
};
useNullAsDefault = true;
break;

default:
Expand All @@ -181,6 +183,7 @@ export function getSettings(): Knex.Config {
},
pool: { min: 0, max: 10 },
debug: process.env.DEBUG ? true : false,
useNullAsDefault: useNullAsDefault,
};

return settings;
Expand Down

0 comments on commit 2a39b85

Please sign in to comment.