@@ -7,32 +7,33 @@ var Sequelize = require('sequelize');
77var debug = require ( 'debug' ) ( 'sql' ) ;
88
99var Op = Sequelize . Op ;
10+ // enable only operators that you need
1011var operatorsAliases = {
11- $and : Op . and ,
12- $or : Op . or ,
12+ // $and: Op.and,
13+ // $or: Op.or,
1314 $gt : Op . gt ,
1415 $gte : Op . gte ,
1516 $lt : Op . lt ,
1617 $lte : Op . lte ,
17- $ne : Op . ne ,
18- $eq : Op . eq ,
19- $not : Op . not ,
20- $between : Op . between ,
21- $notBetween : Op . notBetween ,
22- $in : Op . in ,
23- $notIn : Op . notIn ,
18+ // $ne: Op.ne,
19+ // $eq: Op.eq,
20+ // $not: Op.not,
21+ // $between: Op.between,
22+ // $notBetween: Op.notBetween,
23+ // $in: Op.in,
24+ // $notIn: Op.notIn,
2425 $like : Op . like ,
25- $notLike : Op . notLike ,
26- $iLike : Op . iLike , // PG Only
27- $notILike : Op . notILike , // PG Only
28- $regexp : Op . regexp , // PG/mySQL Only
29- $notReqexp : Op . notRegexp , // PG/mySQL Only
30- $iRegexp : Op . iRegexp , // PG Only
31- $notIRegexp : Op . notIRegexp , // PG Only
32- $overlap : Op . overlap , // PG Only
33- $contains : Op . contains , // PG Only
34- $contained : Op . contained , // PG Only
35- $any : Op . any // PG Only
26+ // $notLike: Op.notLike,
27+ // $iLike: Op.iLike, // PG Only
28+ // $notILike: Op.notILike, // PG Only
29+ // $regexp: Op.regexp, // PG/mySQL Only
30+ // $notReqexp: Op.notRegexp, // PG/mySQL Only
31+ // $iRegexp: Op.iRegexp, // PG Only
32+ // $notIRegexp: Op.notIRegexp, // PG Only
33+ // $overlap: Op.overlap, // PG Only
34+ // $contains: Op.contains, // PG Only
35+ // $contained: Op.contained, // PG Only
36+ // $any: Op.any // PG Only
3637} ;
3738
3839var options = { operatorsAliases : operatorsAliases } ;
@@ -45,10 +46,13 @@ options.pool = {
4546 acquire : 30000 ,
4647 idle : 10000
4748} ;
49+ options . timezone = config . SQLTimezone ;
4850// SQLite only
4951// options.storage = 'path/to/database.sqlite';
5052
51- options . logging = false ;
53+ options . logging = function ( log ) {
54+ return ( process . env . NODE_ENV === 'production' ) ? false : debug ( log ) ;
55+ } ;
5256
5357var sequelize = new Sequelize ( config . SQLDatabase , config . SQLUsername , config . SQLPassword , options ) ;
5458
0 commit comments