@@ -47,28 +47,27 @@ module.exports = function(dialect) {
4747 }
4848 } ) ;
4949
50-
5150 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' ) ;
5857
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 ) ;
6160
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' ) ;
6463
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' ] ) ;
6766
68- templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
67+ templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
6968
70- }
71- } ) ;
69+ }
70+ } ) ;
7271
7372 dialect . templates . add ( 'insertValues' , {
7473 pattern : '({fields}) {returning} values {values}' ,
@@ -85,47 +84,47 @@ module.exports = function(dialect) {
8584 }
8685 } ) ;
8786
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' ) ;
9493
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 ) ;
9796
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' ) ;
10099
101100 templateChecks . propType ( type , params , 'returning' , [ 'array' , 'object' ] ) ;
102101
103- templateChecks . propType ( type , params , 'alias' , 'string' ) ;
102+ templateChecks . propType ( type , params , 'alias' , 'string' ) ;
104103
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' ) ;
107106
108- templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
107+ templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
109108
110- }
111- } ) ;
109+ }
110+ } ) ;
112111
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' ) ;
119118
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' ) ;
122121
123122 templateChecks . propType ( type , params , 'returning' , [ 'array' , 'object' ] ) ;
124123
125- templateChecks . propType ( type , params , 'alias' , 'string' ) ;
124+ templateChecks . propType ( type , params , 'alias' , 'string' ) ;
126125
127- templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
126+ templateChecks . propType ( type , params , 'condition' , [ 'array' , 'object' ] ) ;
128127
129- }
130- } ) ;
128+ }
129+ } ) ;
131130} ;
0 commit comments