File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,12 +41,12 @@ if (nodeEnv === 'test') {
4141}
4242
4343export const sequelize = new Sequelize ( config [ dbConfigKey ] ) ;
44- installSqlitePragmas ( sequelize ) ;
44+ installSqlitePragmas ( sequelize , logger ) ;
4545
4646const mirrorConfig =
4747 ( process . env . NODE_ENV || 'local' ) === 'local' ? 'mirror' : 'mirrorTest' ;
4848export const sequelizeMirror = new Sequelize ( config [ mirrorConfig ] ) ;
49- installSqlitePragmas ( sequelizeMirror ) ;
49+ installSqlitePragmas ( sequelizeMirror , logger ) ;
5050
5151// Snapshot of whether V1 MIRROR_DB was fully configured at module-load time.
5252// Captured alongside sequelizeMirror construction so mirrorDBEnabled() stays
Original file line number Diff line number Diff line change 1- import { logger } from '../config/logger.js' ;
2-
31const SQLITE_PRAGMAS = [
42 'PRAGMA journal_mode = WAL' ,
53 'PRAGMA synchronous = NORMAL' ,
@@ -24,7 +22,7 @@ const applySqlitePragmas = async (connection) => {
2422 } ) ;
2523} ;
2624
27- export const installSqlitePragmas = ( sequelize ) => {
25+ export const installSqlitePragmas = ( sequelize , pragmaLogger = console ) => {
2826 if ( sequelize . getDialect ( ) !== 'sqlite' ) {
2927 return ;
3028 }
@@ -42,7 +40,7 @@ export const installSqlitePragmas = (sequelize) => {
4240 configuredConnections . add ( connection ) ;
4341 } catch ( error ) {
4442 const message = error instanceof Error ? error . message : String ( error ) ;
45- logger . warn ( `Could not apply SQLite PRAGMAs: ${ message } ` ) ;
43+ pragmaLogger . warn ( `Could not apply SQLite PRAGMAs: ${ message } ` ) ;
4644 }
4745 }
4846
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ if (nodeEnv === 'test') {
4040}
4141
4242export const sequelizeV2 = new Sequelize ( config [ dbConfigKey ] ) ;
43- installSqlitePragmas ( sequelizeV2 ) ;
43+ installSqlitePragmas ( sequelizeV2 , loggerV2 ) ;
4444
4545// Determine if MySQL mirror is configured by checking the actual config values
4646// This allows MySQL mirror to work in any environment (local, test, production)
@@ -82,7 +82,7 @@ const isMysqlMirrorConfiguredForReconnectV2 = () => {
8282} ;
8383
8484export const sequelizeV2Mirror = new Sequelize ( config [ mirrorConfig ] ) ;
85- installSqlitePragmas ( sequelizeV2Mirror ) ;
85+ installSqlitePragmas ( sequelizeV2Mirror , loggerV2 ) ;
8686
8787// Snapshot of "is the mirror Sequelize instance actually pointing at MySQL"
8888// taken at module-load time, alongside sequelizeV2Mirror construction.
You can’t perform that action at this time.
0 commit comments