File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,35 @@ var templateChecks = require('../../utils/templateChecks');
77
88var Dialect = module . exports = function ( builder ) {
99 builder . options . valuesPrefix = '@' ;
10+
11+ builder . _pushValue = function ( value ) {
12+ if ( _ . isUndefined ( value ) || _ . isNull ( value ) ) {
13+ return 'null' ;
14+ } else if ( _ . isBoolean ( value ) ) {
15+ return String ( Number ( value ) ) ;
16+ } else if ( _ . isNumber ( value ) ) {
17+ return String ( value ) ;
18+ } else if ( _ . isString ( value ) || _ . isDate ( value ) ) {
19+ if ( this . options . separatedValues ) {
20+ var placeholder = this . _getPlaceholder ( ) ;
21+
22+ if ( this . options . namedValues ) {
23+ this . _values [ placeholder ] = value ;
24+ } else {
25+ this . _values . push ( value ) ;
26+ }
27+
28+ return this . _wrapPlaceholder ( placeholder ) ;
29+ } else {
30+ if ( _ . isDate ( value ) ) value = value . toISOString ( ) ;
31+
32+ return '\'' + value + '\'' ;
33+ }
34+ } else {
35+ throw new Error ( 'Wrong value type "' + ( typeof value ) + '"' ) ;
36+ }
37+ } ;
38+
1039 BaseDialect . call ( this , builder ) ;
1140
1241 this . blocks . set ( 'limit' , function ( params ) {
You can’t perform that action at this time.
0 commit comments