File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -56,23 +56,19 @@ class ErrsolePostgres extends EventEmitter {
5656 constructor ( options = { } ) {
5757 super ( ) ;
5858
59- const { tablePrefix = '' , ...pgOptions } = options ;
59+ let { tablePrefix, ...pgOptions } = options ;
60+ tablePrefix = tablePrefix ? `errsole_${ tablePrefix . toLowerCase ( ) . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) } ` : 'errsole' ;
6061
61- this . tablePrefix = tablePrefix
62- ? `errsole_${ tablePrefix . toLowerCase ( ) . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) } `
63- : 'errsole' ;
64-
65- this . logsTable = `${ this . tablePrefix } _logs_v2` ;
66- this . usersTable = `${ this . tablePrefix } _users` ;
67- this . configTable = `${ this . tablePrefix } _config` ;
68- this . notificationsTable = `${ this . tablePrefix } _notifications` ;
62+ this . isConnectionInProgress = true ;
63+ this . pool = new Pool ( pgOptions ) ;
64+ this . logsTable = `${ tablePrefix } _logs_v2` ;
65+ this . usersTable = `${ tablePrefix } _users` ;
66+ this . configTable = `${ tablePrefix } _config` ;
67+ this . notificationsTable = `${ tablePrefix } _notifications` ;
6968
7069 this . name = require ( '../package.json' ) . name ;
7170 this . version = require ( '../package.json' ) . version || '0.0.0' ;
7271
73- this . isConnectionInProgress = true ;
74- this . pool = new Pool ( pgOptions ) ;
75-
7672 this . pendingLogs = [ ] ;
7773 this . batchSize = 100 ;
7874 this . flushInterval = 1000 ;
You can’t perform that action at this time.
0 commit comments