File tree 1 file changed +29
-0
lines changed
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');
7
7
8
8
var Dialect = module . exports = function ( builder ) {
9
9
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
+
10
39
BaseDialect . call ( this , builder ) ;
11
40
12
41
this . blocks . set ( 'limit' , function ( params ) {
You can’t perform that action at this time.
0 commit comments