From 19c007901d7b4397c9d35ae1beb2cc386bbb4438 Mon Sep 17 00:00:00 2001 From: Pedro Ramos Date: Tue, 14 Jun 2022 15:27:11 -0300 Subject: [PATCH] Add warning for undefined connection file (#5223) --- lib/dialects/sqlite3/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/dialects/sqlite3/index.js b/lib/dialects/sqlite3/index.js index 2bb81675e6..2efdbb982c 100644 --- a/lib/dialects/sqlite3/index.js +++ b/lib/dialects/sqlite3/index.js @@ -20,6 +20,15 @@ const QueryBuilder = require('./query/sqlite-querybuilder'); class Client_SQLite3 extends Client { constructor(config) { super(config); + + if (config.connection && config.connection.filename === undefined) { + this.logger.warn( + 'Could not find `connection.filename` in config. Please specify ' + + 'the database path and name to avoid errors. ' + + '(see docs https://knexjs.org/guide/#configuration-options)' + ); + } + if (config.useNullAsDefault === undefined) { this.logger.warn( 'sqlite does not support inserting default values. Set the ' +