@@ -48,6 +48,9 @@ WOQL.lower = function(u, l){ return new WOQLQuery().lower(u, l); }
48
48
WOQL . pad = function ( input , pad , len , output ) { return new WOQLQuery ( ) . pad ( input , pad , len , output ) ; }
49
49
WOQL . join = function ( ...list ) { return new WOQLQuery ( ) . join ( ...list ) ; }
50
50
WOQL . unique = function ( prefix , vari , type ) { return new WOQLQuery ( ) . unique ( prefix , vari , type ) ; }
51
+ WOQL . idgen = function ( prefix , vari , type , output ) { return new WOQLQuery ( ) . idgen ( prefix , vari , type , output ) ; }
52
+ WOQL . typecast = function ( vara , type , varb ) { return new WOQLQuery ( ) . typecast ( vara , type , varb ) ; }
53
+
51
54
52
55
/* Mathematical Processing */
53
56
WOQL . eval = function ( arith , v ) { return new WOQLQuery ( ) . eval ( arith , v ) ; }
@@ -147,6 +150,10 @@ WOQLQuery.prototype.buildAsClauses = function(vars, cols){
147
150
return clauses ;
148
151
}
149
152
153
+ WOQLQuery . prototype . typecast = function ( va , type , vb ) {
154
+ this . cursor [ 'typecast' ] = [ va , type , vb ] ;
155
+ return this ;
156
+ }
150
157
151
158
152
159
WOQLQuery . prototype . remote = function ( json ) {
@@ -189,6 +196,24 @@ WOQLQuery.prototype.group_by = function(gvarlist, groupedvar, groupquery, output
189
196
return this ;
190
197
}
191
198
199
+ WOQLQuery . prototype . idgen = function ( prefix , vari , type , mode ) {
200
+ this . cursor [ 'idgen' ] = [ prefix ] ;
201
+ if ( vari . json ) {
202
+ this . cursor [ 'idgen' ] . push ( vari . json ( ) ) ;
203
+ }
204
+ else if ( vari . list ) {
205
+ this . cursor [ 'idgen' ] . push ( vari ) ;
206
+ }
207
+ else {
208
+ this . cursor [ 'idgen' ] . push ( { "list" : vari } )
209
+ }
210
+ if ( mode ) {
211
+ this . cursor [ 'idgen' ] . push ( mode ) ;
212
+ }
213
+ this . cursor [ 'idgen' ] . push ( type ) ;
214
+ return this ;
215
+ }
216
+
192
217
193
218
WOQLQuery . prototype . unique = function ( prefix , vari , type ) {
194
219
this . cursor [ 'unique' ] = [ prefix ] ;
@@ -209,6 +234,13 @@ WOQLQuery.prototype.unique = function(prefix, vari, type){
209
234
WOQLQuery . prototype . concat = function ( list , v ) {
210
235
if ( typeof list == "string" ) {
211
236
var nlist = list . split ( / ( v : [ \w _ ] + ) \b / ) ;
237
+ var nxlist = [ ] ;
238
+ for ( var i = 1 ; i < nlist . length ; i ++ ) {
239
+ if ( nlist [ i - 1 ] . substring ( nlist [ i - 1 ] . length - 1 ) == "v" && nlist [ i ] . substring ( 0 , 1 ) == ":" ) {
240
+ nlist [ i - 1 ] = nlist [ i - 1 ] . substring ( 0 , nlist [ i - 1 ] . length - 1 ) ;
241
+ nlist [ i ] = nlist [ i ] . substring ( 1 ) ;
242
+ }
243
+ }
212
244
}
213
245
else if ( list . list ) {
214
246
var nlist = list . list ;
0 commit comments