@@ -47,28 +47,27 @@ module.exports = function(dialect) {
47
47
}
48
48
} ) ;
49
49
50
-
51
50
dialect . templates . add ( 'insert' , {
52
- pattern : '{with} {withRecursive} insert {or} into {table} {values} ' +
53
- '{condition}' ,
54
- validate : function ( type , params ) {
55
- templateChecks . onlyOneOfProps ( type , params , [ 'with' , 'withRecursive' ] ) ;
56
- templateChecks . propType ( type , params , 'with' , 'object' ) ;
57
- templateChecks . propType ( type , params , 'withRecursive' , 'object' ) ;
51
+ pattern : '{with} {withRecursive} insert {or} into {table} {values} ' +
52
+ '{condition}' ,
53
+ validate : function ( type , params ) {
54
+ templateChecks . onlyOneOfProps ( type , params , [ 'with' , 'withRecursive' ] ) ;
55
+ templateChecks . propType ( type , params , 'with' , 'object' ) ;
56
+ templateChecks . propType ( type , params , 'withRecursive' , 'object' ) ;
58
57
59
- templateChecks . propType ( type , params , 'or' , 'string' ) ;
60
- templateChecks . propMatch ( type , params , 'or' , orRegExp ) ;
58
+ templateChecks . propType ( type , params , 'or' , 'string' ) ;
59
+ templateChecks . propMatch ( type , params , 'or' , orRegExp ) ;
61
60
62
- templateChecks . requiredProp ( type , params , 'table' ) ;
63
- templateChecks . propType ( type , params , 'table' , 'string' ) ;
61
+ templateChecks . requiredProp ( type , params , 'table' ) ;
62
+ templateChecks . propType ( type , params , 'table' , 'string' ) ;
64
63
65
- templateChecks . requiredProp ( type , params , 'values' ) ;
66
- templateChecks . propType ( type , params , 'values' , [ 'array' , 'object' ] ) ;
64
+ templateChecks . requiredProp ( type , params , 'values' ) ;
65
+ templateChecks . propType ( type , params , 'values' , [ 'array' , 'object' ] ) ;
67
66
68
- templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
67
+ templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
69
68
70
- }
71
- } ) ;
69
+ }
70
+ } ) ;
72
71
73
72
dialect . templates . add ( 'insertValues' , {
74
73
pattern : '({fields}) {returning} values {values}' ,
@@ -85,47 +84,47 @@ module.exports = function(dialect) {
85
84
}
86
85
} ) ;
87
86
88
- dialect . templates . add ( 'update' , {
89
- pattern : '{with} {withRecursive} update {or} {table} {alias} {modifier} {returning} {condition} ' ,
90
- validate : function ( type , params ) {
91
- templateChecks . onlyOneOfProps ( type , params , [ 'with' , 'withRecursive' ] ) ;
92
- templateChecks . propType ( type , params , 'with' , 'object' ) ;
93
- templateChecks . propType ( type , params , 'withRecursive' , 'object' ) ;
87
+ dialect . templates . add ( 'update' , {
88
+ pattern : '{with} {withRecursive} update {or} {table} {alias} {modifier} {returning} {condition} ' ,
89
+ validate : function ( type , params ) {
90
+ templateChecks . onlyOneOfProps ( type , params , [ 'with' , 'withRecursive' ] ) ;
91
+ templateChecks . propType ( type , params , 'with' , 'object' ) ;
92
+ templateChecks . propType ( type , params , 'withRecursive' , 'object' ) ;
94
93
95
- templateChecks . propType ( type , params , 'or' , 'string' ) ;
96
- templateChecks . propMatch ( type , params , 'or' , orRegExp ) ;
94
+ templateChecks . propType ( type , params , 'or' , 'string' ) ;
95
+ templateChecks . propMatch ( type , params , 'or' , orRegExp ) ;
97
96
98
- templateChecks . requiredProp ( type , params , 'table' ) ;
99
- templateChecks . propType ( type , params , 'table' , 'string' ) ;
97
+ templateChecks . requiredProp ( type , params , 'table' ) ;
98
+ templateChecks . propType ( type , params , 'table' , 'string' ) ;
100
99
101
100
templateChecks . propType ( type , params , 'returning' , [ 'array' , 'object' ] ) ;
102
101
103
- templateChecks . propType ( type , params , 'alias' , 'string' ) ;
102
+ templateChecks . propType ( type , params , 'alias' , 'string' ) ;
104
103
105
- templateChecks . requiredProp ( type , params , 'modifier' ) ;
106
- templateChecks . propType ( type , params , 'modifier' , 'object' ) ;
104
+ templateChecks . requiredProp ( type , params , 'modifier' ) ;
105
+ templateChecks . propType ( type , params , 'modifier' , 'object' ) ;
107
106
108
- templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
107
+ templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
109
108
110
- }
111
- } ) ;
109
+ }
110
+ } ) ;
112
111
113
- dialect . templates . add ( 'remove' , {
114
- pattern : '{with} {withRecursive} delete from {table} {returning} {alias} {condition} ' ,
115
- validate : function ( type , params ) {
116
- templateChecks . onlyOneOfProps ( type , params , [ 'with' , 'withRecursive' ] ) ;
117
- templateChecks . propType ( type , params , 'with' , 'object' ) ;
118
- templateChecks . propType ( type , params , 'withRecursive' , 'object' ) ;
112
+ dialect . templates . add ( 'remove' , {
113
+ pattern : '{with} {withRecursive} delete from {table} {returning} {alias} {condition} ' ,
114
+ validate : function ( type , params ) {
115
+ templateChecks . onlyOneOfProps ( type , params , [ 'with' , 'withRecursive' ] ) ;
116
+ templateChecks . propType ( type , params , 'with' , 'object' ) ;
117
+ templateChecks . propType ( type , params , 'withRecursive' , 'object' ) ;
119
118
120
- templateChecks . requiredProp ( type , params , 'table' ) ;
121
- templateChecks . propType ( type , params , 'table' , 'string' ) ;
119
+ templateChecks . requiredProp ( type , params , 'table' ) ;
120
+ templateChecks . propType ( type , params , 'table' , 'string' ) ;
122
121
123
122
templateChecks . propType ( type , params , 'returning' , [ 'array' , 'object' ] ) ;
124
123
125
- templateChecks . propType ( type , params , 'alias' , 'string' ) ;
124
+ templateChecks . propType ( type , params , 'alias' , 'string' ) ;
126
125
127
- templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
126
+ templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
128
127
129
- }
130
- } ) ;
128
+ }
129
+ } ) ;
131
130
} ;
0 commit comments