Comparing version 0.1.8 to 0.1.9
var typedoc = typedoc || {}; | ||
typedoc.search = typedoc.search || {}; | ||
typedoc.search.data = {"kinds":{"2":"Module","4":"Enumeration","16":"Enumeration member","64":"Function","128":"Class","256":"Interface","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":128,"name":"ColName","url":"classes/colname.html","classes":"tsd-kind-class"},{"id":1,"kind":2048,"name":"wrap","url":"classes/colname.html#wrap","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"ColName"},{"id":2,"kind":2048,"name":"unwrap","url":"classes/colname.html#unwrap","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"ColName"},{"id":3,"kind":1024,"name":"dummy","url":"classes/colname.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"ColName"},{"id":4,"kind":128,"name":"TableName","url":"classes/tablename.html","classes":"tsd-kind-class"},{"id":5,"kind":2048,"name":"wrap","url":"classes/tablename.html#wrap","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"TableName"},{"id":6,"kind":2048,"name":"unwrap","url":"classes/tablename.html#unwrap","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"TableName"},{"id":7,"kind":1024,"name":"dummy","url":"classes/tablename.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"TableName"},{"id":8,"kind":4,"name":"Order","url":"enums/order.html","classes":"tsd-kind-enum"},{"id":9,"kind":16,"name":"Asc","url":"enums/order.html#asc","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Order"},{"id":10,"kind":16,"name":"Desc","url":"enums/order.html#desc","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Order"},{"id":11,"kind":128,"name":"Write","url":"classes/write.html","classes":"tsd-kind-class"},{"id":12,"kind":1024,"name":"dummy","url":"classes/write.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Write"},{"id":13,"kind":128,"name":"DefaultValue","url":"classes/defaultvalue.html","classes":"tsd-kind-class"},{"id":14,"kind":1024,"name":"dummy","url":"classes/defaultvalue.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"DefaultValue"},{"id":15,"kind":128,"name":"Aggr","url":"classes/aggr.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":16,"kind":1024,"name":"dummy","url":"classes/aggr.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Aggr"},{"id":17,"kind":128,"name":"Inner","url":"classes/inner.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":18,"kind":1024,"name":"dummy","url":"classes/inner.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Inner"},{"id":19,"kind":128,"name":"Table","url":"classes/table.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":20,"kind":1024,"name":"tableName","url":"classes/table.html#tablename","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Table"},{"id":21,"kind":1024,"name":"tableCols","url":"classes/table.html#tablecols","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Table"},{"id":22,"kind":1024,"name":"dummy","url":"classes/table.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Table"},{"id":23,"kind":256,"name":"ColInfo","url":"interfaces/colinfo.html","classes":"tsd-kind-interface"},{"id":24,"kind":1024,"name":"name","url":"interfaces/colinfo.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ColInfo"},{"id":25,"kind":1024,"name":"propName","url":"interfaces/colinfo.html#propname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ColInfo"},{"id":26,"kind":1024,"name":"parser","url":"interfaces/colinfo.html#parser","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ColInfo"},{"id":27,"kind":65536,"name":"__type","url":"interfaces/colinfo.html#parser.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"ColInfo.parser"},{"id":28,"kind":128,"name":"Col","url":"classes/col.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":29,"kind":1024,"name":"dummy","url":"classes/col.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Col"},{"id":30,"kind":128,"name":"ConflictTarget","url":"classes/conflicttarget.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":31,"kind":2048,"name":"tableColumns","url":"classes/conflicttarget.html#tablecolumns","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"ConflictTarget"},{"id":32,"kind":1024,"name":"dummy","url":"classes/conflicttarget.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"ConflictTarget"},{"id":33,"kind":128,"name":"Arbitrary","url":"classes/arbitrary.html","classes":"tsd-kind-class"},{"id":34,"kind":1024,"name":"dummy","url":"classes/arbitrary.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Arbitrary"},{"id":35,"kind":128,"name":"Q","url":"classes/q.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":36,"kind":1024,"name":"dummy","url":"classes/q.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Q"},{"id":37,"kind":4194304,"name":"MakeTable","url":"index.html#maketable","classes":"tsd-kind-type-alias"},{"id":38,"kind":4194304,"name":"MakeCols","url":"index.html#makecols","classes":"tsd-kind-type-alias"},{"id":39,"kind":65536,"name":"__type","url":"index.html#makecols.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"MakeCols"},{"id":40,"kind":64,"name":"defaultValue","url":"index.html#defaultvalue","classes":"tsd-kind-function"},{"id":41,"kind":64,"name":"count","url":"index.html#count","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":42,"kind":64,"name":"avg","url":"index.html#avg","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":43,"kind":64,"name":"sum","url":"index.html#sum","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":44,"kind":64,"name":"max","url":"index.html#max","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":45,"kind":64,"name":"min","url":"index.html#min","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":46,"kind":64,"name":"inList","url":"index.html#inlist","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":47,"kind":4194304,"name":"AggrCols","url":"index.html#aggrcols","classes":"tsd-kind-type-alias"},{"id":48,"kind":65536,"name":"__type","url":"index.html#aggrcols.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"AggrCols"},{"id":49,"kind":4194304,"name":"LeftCols","url":"index.html#leftcols","classes":"tsd-kind-type-alias"},{"id":50,"kind":65536,"name":"__type","url":"index.html#leftcols.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"LeftCols"},{"id":51,"kind":64,"name":"declareTable","url":"index.html#declaretable","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":52,"kind":4194304,"name":"TableDeclareCols","url":"index.html#tabledeclarecols","classes":"tsd-kind-type-alias"},{"id":53,"kind":65536,"name":"__type","url":"index.html#tabledeclarecols.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"TableDeclareCols"},{"id":54,"kind":64,"name":"nullCol","url":"index.html#nullcol","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":55,"kind":64,"name":"numberCol","url":"index.html#numbercol","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":56,"kind":64,"name":"textCol","url":"index.html#textcol","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":57,"kind":64,"name":"booleanCol","url":"index.html#booleancol","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":58,"kind":64,"name":"update","url":"index.html#update","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":59,"kind":64,"name":"updateReturning","url":"index.html#updatereturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":60,"kind":64,"name":"insertReturning","url":"index.html#insertreturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":61,"kind":64,"name":"insert","url":"index.html#insert","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":62,"kind":64,"name":"insertOnConflictDoNothingReturning","url":"index.html#insertonconflictdonothingreturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":63,"kind":64,"name":"insertOnConflictDoNothing","url":"index.html#insertonconflictdonothing","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":64,"kind":64,"name":"insertOnConflictDoUpdateReturning","url":"index.html#insertonconflictdoupdatereturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":65,"kind":64,"name":"insertOnConflictDoUpdate","url":"index.html#insertonconflictdoupdate","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":66,"kind":64,"name":"insertManyReturning","url":"index.html#insertmanyreturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":67,"kind":64,"name":"insertMany","url":"index.html#insertmany","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":68,"kind":64,"name":"insertManyOnConflictDoNothingReturning","url":"index.html#insertmanyonconflictdonothingreturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":69,"kind":64,"name":"insertManyOnConflictDoNothing","url":"index.html#insertmanyonconflictdonothing","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":70,"kind":64,"name":"insertManyOnConflictDoUpdateReturning","url":"index.html#insertmanyonconflictdoupdatereturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":71,"kind":64,"name":"insertManyOnConflictDoUpdate","url":"index.html#insertmanyonconflictdoupdate","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":72,"kind":64,"name":"delete_","url":"index.html#delete_","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":73,"kind":2,"name":"pg","url":"modules/pg.html","classes":"tsd-kind-module"},{"id":74,"kind":64,"name":"query","url":"index.html#query","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":75,"kind":64,"name":"restrict","url":"index.html#restrict","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":76,"kind":64,"name":"groupBy","url":"index.html#groupby","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":77,"kind":64,"name":"aggregate","url":"index.html#aggregate","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":78,"kind":64,"name":"inQuery","url":"index.html#inquery","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":79,"kind":64,"name":"exists","url":"index.html#exists","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":80,"kind":64,"name":"arbitrary","url":"index.html#arbitrary","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":81,"kind":64,"name":"leftJoin","url":"index.html#leftjoin","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":82,"kind":64,"name":"innerJoin","url":"index.html#innerjoin","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":83,"kind":64,"name":"inner","url":"index.html#inner","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":84,"kind":64,"name":"suchThat","url":"index.html#suchthat","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":85,"kind":64,"name":"select","url":"index.html#select","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":86,"kind":64,"name":"limit","url":"index.html#limit","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":87,"kind":64,"name":"order","url":"index.html#order","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":88,"kind":64,"name":"isNull","url":"index.html#isnull","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":89,"kind":64,"name":"isNotNull","url":"index.html#isnotnull","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":90,"kind":64,"name":"not","url":"index.html#not","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":91,"kind":64,"name":"restrictEq","url":"index.html#restricteq","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":92,"kind":64,"name":"like","url":"index.html#like","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":93,"kind":64,"name":"ilike","url":"index.html#ilike","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":94,"kind":64,"name":"e","url":"index.html#e","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":95,"kind":2,"name":"Debug","url":"modules/debug.html","classes":"tsd-kind-module"},{"id":96,"kind":2,"name":"SqlType","url":"modules/sqltype.html","classes":"tsd-kind-module"},{"id":97,"kind":64,"name":"unsafeCast","url":"index.html#unsafecast","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":98,"kind":64,"name":"unsafeFun","url":"index.html#unsafefun","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":99,"kind":64,"name":"unsafeFun2","url":"index.html#unsafefun2","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":100,"kind":64,"name":"unsafeFun3","url":"index.html#unsafefun3","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":101,"kind":64,"name":"unsafeAggr","url":"index.html#unsafeaggr","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":102,"kind":64,"name":"unsafeBinOp","url":"index.html#unsafebinop","classes":"tsd-kind-function tsd-has-type-parameter"}]}; | ||
typedoc.search.data = {"kinds":{"2":"Module","4":"Enumeration","16":"Enumeration member","64":"Function","128":"Class","256":"Interface","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":128,"name":"ColName","url":"classes/colname.html","classes":"tsd-kind-class"},{"id":1,"kind":2048,"name":"wrap","url":"classes/colname.html#wrap","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"ColName"},{"id":2,"kind":2048,"name":"unwrap","url":"classes/colname.html#unwrap","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"ColName"},{"id":3,"kind":1024,"name":"dummy","url":"classes/colname.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"ColName"},{"id":4,"kind":128,"name":"TableName","url":"classes/tablename.html","classes":"tsd-kind-class"},{"id":5,"kind":2048,"name":"wrap","url":"classes/tablename.html#wrap","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"TableName"},{"id":6,"kind":2048,"name":"unwrap","url":"classes/tablename.html#unwrap","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"TableName"},{"id":7,"kind":1024,"name":"dummy","url":"classes/tablename.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"TableName"},{"id":8,"kind":4,"name":"Order","url":"enums/order.html","classes":"tsd-kind-enum"},{"id":9,"kind":16,"name":"Asc","url":"enums/order.html#asc","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Order"},{"id":10,"kind":16,"name":"Desc","url":"enums/order.html#desc","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Order"},{"id":11,"kind":128,"name":"Write","url":"classes/write.html","classes":"tsd-kind-class"},{"id":12,"kind":1024,"name":"dummy","url":"classes/write.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Write"},{"id":13,"kind":128,"name":"DefaultValue","url":"classes/defaultvalue.html","classes":"tsd-kind-class"},{"id":14,"kind":1024,"name":"dummy","url":"classes/defaultvalue.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"DefaultValue"},{"id":15,"kind":128,"name":"Aggr","url":"classes/aggr.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":16,"kind":1024,"name":"dummy","url":"classes/aggr.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Aggr"},{"id":17,"kind":128,"name":"Inner","url":"classes/inner.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":18,"kind":1024,"name":"dummy","url":"classes/inner.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Inner"},{"id":19,"kind":128,"name":"Table","url":"classes/table.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":20,"kind":1024,"name":"tableName","url":"classes/table.html#tablename","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Table"},{"id":21,"kind":1024,"name":"tableCols","url":"classes/table.html#tablecols","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Table"},{"id":22,"kind":1024,"name":"dummy","url":"classes/table.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Table"},{"id":23,"kind":256,"name":"ColInfo","url":"interfaces/colinfo.html","classes":"tsd-kind-interface"},{"id":24,"kind":1024,"name":"name","url":"interfaces/colinfo.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ColInfo"},{"id":25,"kind":1024,"name":"propName","url":"interfaces/colinfo.html#propname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ColInfo"},{"id":26,"kind":1024,"name":"parser","url":"interfaces/colinfo.html#parser","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ColInfo"},{"id":27,"kind":65536,"name":"__type","url":"interfaces/colinfo.html#parser.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"ColInfo.parser"},{"id":28,"kind":128,"name":"Col","url":"classes/col.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":29,"kind":1024,"name":"dummy","url":"classes/col.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Col"},{"id":30,"kind":128,"name":"ConflictTarget","url":"classes/conflicttarget.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":31,"kind":2048,"name":"tableColumns","url":"classes/conflicttarget.html#tablecolumns","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"ConflictTarget"},{"id":32,"kind":1024,"name":"dummy","url":"classes/conflicttarget.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"ConflictTarget"},{"id":33,"kind":128,"name":"Arbitrary","url":"classes/arbitrary.html","classes":"tsd-kind-class"},{"id":34,"kind":1024,"name":"dummy","url":"classes/arbitrary.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Arbitrary"},{"id":35,"kind":128,"name":"Q","url":"classes/q.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":36,"kind":1024,"name":"dummy","url":"classes/q.html#dummy","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-protected","parent":"Q"},{"id":37,"kind":4194304,"name":"MakeTable","url":"index.html#maketable","classes":"tsd-kind-type-alias"},{"id":38,"kind":4194304,"name":"MakeCols","url":"index.html#makecols","classes":"tsd-kind-type-alias"},{"id":39,"kind":65536,"name":"__type","url":"index.html#makecols.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"MakeCols"},{"id":40,"kind":64,"name":"defaultValue","url":"index.html#defaultvalue","classes":"tsd-kind-function"},{"id":41,"kind":64,"name":"count","url":"index.html#count","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":42,"kind":64,"name":"avg","url":"index.html#avg","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":43,"kind":64,"name":"sum","url":"index.html#sum","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":44,"kind":64,"name":"max","url":"index.html#max","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":45,"kind":64,"name":"min","url":"index.html#min","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":46,"kind":64,"name":"inList","url":"index.html#inlist","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":47,"kind":4194304,"name":"AggrCols","url":"index.html#aggrcols","classes":"tsd-kind-type-alias"},{"id":48,"kind":65536,"name":"__type","url":"index.html#aggrcols.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"AggrCols"},{"id":49,"kind":4194304,"name":"LeftCols","url":"index.html#leftcols","classes":"tsd-kind-type-alias"},{"id":50,"kind":65536,"name":"__type","url":"index.html#leftcols.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"LeftCols"},{"id":51,"kind":64,"name":"declareTable","url":"index.html#declaretable","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":52,"kind":4194304,"name":"TableDeclareCols","url":"index.html#tabledeclarecols","classes":"tsd-kind-type-alias"},{"id":53,"kind":65536,"name":"__type","url":"index.html#tabledeclarecols.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"TableDeclareCols"},{"id":54,"kind":64,"name":"nullCol","url":"index.html#nullcol","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":55,"kind":64,"name":"numberCol","url":"index.html#numbercol","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":56,"kind":64,"name":"textCol","url":"index.html#textcol","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":57,"kind":64,"name":"booleanCol","url":"index.html#booleancol","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":58,"kind":64,"name":"ifThenElse","url":"index.html#ifthenelse","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":59,"kind":64,"name":"matchNullable","url":"index.html#matchnullable","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":60,"kind":64,"name":"update","url":"index.html#update","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":61,"kind":64,"name":"updateReturning","url":"index.html#updatereturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":62,"kind":64,"name":"insertReturning","url":"index.html#insertreturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":63,"kind":64,"name":"insert","url":"index.html#insert","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":64,"kind":64,"name":"insertOnConflictDoNothingReturning","url":"index.html#insertonconflictdonothingreturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":65,"kind":64,"name":"insertOnConflictDoNothing","url":"index.html#insertonconflictdonothing","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":66,"kind":64,"name":"insertOnConflictDoUpdateReturning","url":"index.html#insertonconflictdoupdatereturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":67,"kind":64,"name":"insertOnConflictDoUpdate","url":"index.html#insertonconflictdoupdate","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":68,"kind":64,"name":"insertManyReturning","url":"index.html#insertmanyreturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":69,"kind":64,"name":"insertMany","url":"index.html#insertmany","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":70,"kind":64,"name":"insertManyOnConflictDoNothingReturning","url":"index.html#insertmanyonconflictdonothingreturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":71,"kind":64,"name":"insertManyOnConflictDoNothing","url":"index.html#insertmanyonconflictdonothing","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":72,"kind":64,"name":"insertManyOnConflictDoUpdateReturning","url":"index.html#insertmanyonconflictdoupdatereturning","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":73,"kind":64,"name":"insertManyOnConflictDoUpdate","url":"index.html#insertmanyonconflictdoupdate","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":74,"kind":64,"name":"delete_","url":"index.html#delete_","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":75,"kind":2,"name":"pg","url":"modules/pg.html","classes":"tsd-kind-module"},{"id":76,"kind":64,"name":"query","url":"index.html#query","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":77,"kind":64,"name":"restrict","url":"index.html#restrict","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":78,"kind":64,"name":"groupBy","url":"index.html#groupby","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":79,"kind":64,"name":"aggregate","url":"index.html#aggregate","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":80,"kind":64,"name":"inQuery","url":"index.html#inquery","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":81,"kind":64,"name":"exists","url":"index.html#exists","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":82,"kind":64,"name":"arbitrary","url":"index.html#arbitrary","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":83,"kind":64,"name":"leftJoin","url":"index.html#leftjoin","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":84,"kind":64,"name":"innerJoin","url":"index.html#innerjoin","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":85,"kind":64,"name":"inner","url":"index.html#inner","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":86,"kind":64,"name":"suchThat","url":"index.html#suchthat","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":87,"kind":64,"name":"select","url":"index.html#select","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":88,"kind":64,"name":"selectValues","url":"index.html#selectvalues","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":89,"kind":64,"name":"limit","url":"index.html#limit","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":90,"kind":64,"name":"order","url":"index.html#order","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":91,"kind":64,"name":"isNull","url":"index.html#isnull","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":92,"kind":64,"name":"isNotNull","url":"index.html#isnotnull","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":93,"kind":64,"name":"not","url":"index.html#not","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":94,"kind":64,"name":"restrictEq","url":"index.html#restricteq","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":95,"kind":64,"name":"like","url":"index.html#like","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":96,"kind":64,"name":"ilike","url":"index.html#ilike","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":97,"kind":64,"name":"e","url":"index.html#e","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":98,"kind":2,"name":"Debug","url":"modules/debug.html","classes":"tsd-kind-module"},{"id":99,"kind":2,"name":"SqlType","url":"modules/sqltype.html","classes":"tsd-kind-module"},{"id":100,"kind":64,"name":"unsafeCast","url":"index.html#unsafecast","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":101,"kind":64,"name":"unsafeFun","url":"index.html#unsafefun","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":102,"kind":64,"name":"unsafeFun2","url":"index.html#unsafefun2","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":103,"kind":64,"name":"unsafeFun3","url":"index.html#unsafefun3","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":104,"kind":64,"name":"unsafeAggr","url":"index.html#unsafeaggr","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":105,"kind":64,"name":"unsafeBinOp","url":"index.html#unsafebinop","classes":"tsd-kind-function tsd-has-type-parameter"}]}; |
@@ -120,2 +120,20 @@ import * as pgLib from "pg"; | ||
/** | ||
* Perform a conditional on a column | ||
* | ||
* SQL equivalent: `CASE` | ||
*/ | ||
export declare function ifThenElse<s, a>(if_: Col<s, boolean>, then: Col<s, a>, else_: Col<s, a>): Col<s, a>; | ||
/** | ||
* If the nullable column Column `nullable` is NULL then return the | ||
* replacement column, otherwise map the underlying column using the | ||
* provided function. | ||
* | ||
* @param nullable A nullable column to match against | ||
* @param replacement This is the value that will be returned if the nullable column is NULL | ||
* @param f This function will be called if the nullable column is not null, and its result will be returned | ||
*/ | ||
export declare function matchNullable<s, a, b>(nullable: Col<s, a | null>, replacement: Col<s, b>, f: <s2>(col: Col<s2, a>) => Col<s2, b>): Col<s, b>; | ||
/** | ||
* Update rows of a table | ||
@@ -328,2 +346,8 @@ * | ||
/** | ||
* Query an ad hoc table. Each element in the given list represents one row | ||
* in the ad hoc table. | ||
*/ | ||
export declare function selectValues<s, a extends object>(q: Q<s>, vals: MakeCols<s, a>[]): MakeCols<s, a>; | ||
export declare function limit<s, a extends object>(q: Q<s>, from: number, to: number, query: (q: Q<Inner<s>>) => MakeCols<Inner<s>, a>): MakeCols<s, a>; | ||
@@ -330,0 +354,0 @@ |
{ | ||
"name": "zol", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Type safe composable SQL abstraction layer", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
import { Exp } from "./Exp"; | ||
import { isNull } from "./Operators"; | ||
import { SQL } from "./SQL"; | ||
import { SqlType } from "./SqlType"; | ||
@@ -40,3 +42,4 @@ /** | ||
type: "LNull" | ||
} | ||
}, | ||
parser: val => val | ||
}); | ||
@@ -49,5 +52,6 @@ } | ||
lit: { | ||
type: "LBool", | ||
value: val | ||
} | ||
type: "LText", | ||
value: val ? "t" : "f" | ||
}, | ||
parser: SqlType.booleanParser | ||
}); | ||
@@ -62,3 +66,4 @@ } | ||
value: str | ||
} | ||
}, | ||
parser: SqlType.stringParser | ||
}); | ||
@@ -73,4 +78,37 @@ } | ||
value: val | ||
} | ||
}, | ||
parser: SqlType.numberParser | ||
}); | ||
} | ||
/** | ||
* Perform a conditional on a column | ||
* | ||
* SQL equivalent: `CASE` | ||
*/ | ||
export function ifThenElse<s, a>(if_: Col<s, boolean>, then: Col<s, a>, else_: Col<s, a>): Col<s, a> { | ||
return colWrap({ | ||
type: "EIfThenElse", | ||
expIf: <any>colUnwrap(if_), | ||
expThen: colUnwrap(then), | ||
expElse: colUnwrap(else_), | ||
// the "then" and "else_" columns are of the same type, so they | ||
// (supposedly) have the same parser, so we can arbitrarily pick | ||
// either one: | ||
parser: (<any>colUnwrap(then)).parser | ||
}); | ||
} | ||
/** | ||
* If the nullable column Column `nullable` is NULL then return the | ||
* replacement column, otherwise map the underlying column using the | ||
* provided function. | ||
* | ||
* @param nullable A nullable column to match against | ||
* @param replacement This is the value that will be returned if the nullable column is NULL | ||
* @param f This function will be called if the nullable column is not null, and its result will be returned | ||
*/ | ||
export function matchNullable<s, a, b>(nullable: Col<s, a | null>, replacement: Col<s, b>, f: <s2>(col: Col<s2, a>) => Col<s2, b>): Col<s, b> { | ||
return ifThenElse(isNull(nullable), replacement, f(<any>nullable)); | ||
} |
@@ -18,2 +18,3 @@ import * as SqlType from "./SqlType"; | ||
readonly parser: (val: string) => any; | ||
readonly propName: string; | ||
} | ||
@@ -32,2 +33,3 @@ } | ||
Exp.ECast<sql, a> | | ||
Exp.EIfThenElse<sql, a> | | ||
Exp.EAggrEx<sql, a> | | ||
@@ -53,2 +55,3 @@ Exp.EInList<sql, a> | | ||
readonly lit: SqlType.Lit; | ||
readonly parser: (val: string) => any; | ||
} | ||
@@ -100,2 +103,10 @@ | ||
export interface EIfThenElse<sql, a> { | ||
readonly type: "EIfThenElse"; | ||
readonly expIf: Exp<sql, a>; | ||
readonly expThen: Exp<sql, a>; | ||
readonly expElse: Exp<sql, a>; | ||
readonly parser: (val: string) => any; | ||
} | ||
export interface EAggrEx<sql, a> { | ||
@@ -102,0 +113,0 @@ readonly type: "EAggrEx"; |
@@ -37,3 +37,4 @@ import { assertNever } from "./assertNever"; | ||
exp: x.exp, | ||
parser: x.parser | ||
parser: x.parser, | ||
propName: <any>undefined // doesn't look like this is needed | ||
}; | ||
@@ -40,0 +41,0 @@ return State.pure(named); |
@@ -41,2 +41,13 @@ import { booleanCol, Col, colUnwrap, colWrap, numberCol } from "./Column"; | ||
/** | ||
* Query an ad hoc table. Each element in the given list represents one row | ||
* in the ad hoc table. | ||
*/ | ||
export function selectValues<s, a extends object>(q: Q<s>, vals: MakeCols<s, a>[]): MakeCols<s, a> { | ||
const mutQ: MutQuery = <any>q; | ||
const [x, y] = m.selectValues<s, a>(vals).unQ.runState(mutQ[0]); | ||
mutQ[0] = y; | ||
return x; | ||
} | ||
export function restrict<s>(q: Q<s>, expr: Col<s, boolean>): void { | ||
@@ -43,0 +54,0 @@ const mutQ: MutQuery = <any>q; |
@@ -26,2 +26,4 @@ import { assertNever } from "./assertNever"; | ||
return allNamesInExp(exp.exp); | ||
case "EIfThenElse": | ||
return allNamesInExp(exp.expIf).concat(allNamesInExp(exp.expThen)).concat(allNamesInExp(exp.expElse)); | ||
case "EAggrEx": | ||
@@ -28,0 +30,0 @@ return allNamesInExp(exp.exp); |
117
src/Query.ts
import { Col, colUnwrap, colWrap } from "./Column"; | ||
import { compQuery } from "./Compile"; | ||
import { compQuery, finalCols } from "./Compile"; | ||
import { Exp, SomeCol } from "./Exp"; | ||
import { GenState, rename } from "./GenState"; | ||
import { isolate, Query, queryBind, queryPure } from "./Query/Type"; | ||
import { freshName, isolate, Query, queryBind, queryPure } from "./Query/Type"; | ||
import { JoinType, Order, SQL, SqlSource } from "./SQL"; | ||
@@ -104,2 +104,112 @@ import { SqlType } from "./SqlType"; | ||
/** | ||
* Query an ad hoc table. Each element in the given list represents one row | ||
* in the ad hoc table. | ||
*/ | ||
export function selectValues<s, a extends object>(vals: MakeCols<s, a>[]): Query<s, MakeCols<s, a>> { | ||
if (vals.length === 0) { | ||
const result: Query<s, MakeCols<s, a>> = new Query(resolve => { | ||
resolve( | ||
State.bind( | ||
State.get(), | ||
st => { | ||
const s2: SQL = { | ||
cols: [], | ||
source: { | ||
type: "EmptyTable" | ||
}, | ||
restricts: [], | ||
groups: [], | ||
ordering: [], | ||
limits: null | ||
}; | ||
return State.bind( | ||
State.put({ | ||
...st, | ||
sources: [s2].concat(st.sources) | ||
}), | ||
() => State.pure(<any>{}) | ||
); | ||
} | ||
) | ||
); | ||
}); | ||
return result; | ||
} | ||
const row = vals[0]; | ||
const rows = vals.slice(1); | ||
const firstrow = finalCols(row); | ||
const mkFirstRow = (ns: ColName[]): SomeCol<SQL>[] => { | ||
const results: SomeCol<SQL>[] = []; | ||
for (let i = 0; i < firstrow.length; ++i) { | ||
results.push({ | ||
type: "Named", | ||
colName: ns[i], | ||
exp: firstrow[i].exp, | ||
parser: firstrow[i].parser, | ||
propName: (<any>firstrow[i]).propName | ||
}); | ||
} | ||
return results; | ||
}; | ||
const rows2 = rows.map(finalCols); | ||
const result: Query<s, MakeCols<s, a>> = new Query(resolve => { | ||
resolve( | ||
State.bind( | ||
State.mapM(() => freshName(), firstrow), | ||
names => { | ||
const rns: SomeCol<SQL>[] = []; | ||
let i = 0; | ||
for (const n of names) { | ||
rns.push({ | ||
type: "Named", | ||
colName: n, | ||
exp: { | ||
type: "ECol", | ||
colName: n, | ||
parser: () => { throw new Error("ECol parser"); } | ||
}, | ||
parser: (<any>firstrow[i]).parser, | ||
propName: (<any>firstrow[i]).propName | ||
}); | ||
i++; | ||
} | ||
const row2 = mkFirstRow(names); | ||
return State.bind( | ||
State.get(), | ||
s => { | ||
const s2: SQL = { | ||
cols: rns, | ||
source: { | ||
type: "Values", | ||
cols: row2, | ||
params: rows2 | ||
}, | ||
restricts: [], | ||
groups: [], | ||
ordering: [], | ||
limits: null | ||
}; | ||
return State.bind( | ||
State.put({ | ||
...s, | ||
sources: [s2].concat(s.sources) | ||
}), | ||
() => { | ||
const ts: [ColName, string, (val: string) => any][] = []; | ||
for (const r of rns) { | ||
ts.push([(<SomeCol.Named<SQL>>r).colName, (<SomeCol.Named<SQL>>r).propName, r.parser]); | ||
} | ||
return State.pure(toTup(ts)); | ||
} | ||
); | ||
} | ||
); | ||
} | ||
)); | ||
}); | ||
return result; | ||
} | ||
export function restrict<s>(expr: Col<s, boolean>): Query<s, void> { | ||
@@ -355,3 +465,4 @@ const result: Query<s, void> = new Query(resolve => { | ||
value: false | ||
} | ||
}, | ||
parser: SqlType.booleanParser | ||
}); | ||
@@ -358,0 +469,0 @@ } else { |
import { GenState, initState } from "../GenState"; | ||
import * as State from "../StateMonad"; | ||
import { ColName } from "../Types"; | ||
@@ -104,1 +105,27 @@ export class Query<s, a> implements PromiseLike<a> { | ||
} | ||
/** | ||
* Get a guaranteed unique identifier. | ||
*/ | ||
export function freshId(): State.State<GenState, number> { | ||
return State.bind( | ||
State.get(), | ||
st => State.bind( | ||
State.put({ | ||
...st, | ||
nameSupply: st.nameSupply + 1 | ||
}), | ||
() => State.pure(st.nameSupply) | ||
) | ||
); | ||
} | ||
/** | ||
* Get a guaranteed unique column name. | ||
*/ | ||
export function freshName(): State.State<GenState, ColName> { | ||
return State.bind( | ||
freshId(), | ||
n => State.pure(ColName.wrap("tmp_" + n)) | ||
); | ||
} |
@@ -38,3 +38,3 @@ import { Exp, SomeCol } from "./Exp"; | ||
readonly cols: SomeCol<SQL>[]; | ||
readonly params: Param[][]; | ||
readonly params: SomeCol<SQL>[][]; | ||
} | ||
@@ -41,0 +41,0 @@ |
@@ -238,2 +238,13 @@ import { assertNever } from "../assertNever"; | ||
); | ||
case "EIfThenElse": | ||
return State.bind( | ||
ppCol(c.expIf), | ||
a2 => State.bind( | ||
ppCol(c.expThen), | ||
b2 => State.bind( | ||
ppCol(c.expElse), | ||
c2 => State.pure("CASE WHEN " + a2 + " THEN " + b2 + " ELSE " + c2 + " END") | ||
) | ||
) | ||
); | ||
case "EInList": | ||
@@ -430,3 +441,20 @@ return State.bind( | ||
case "Values": | ||
throw new Error("TODO"); | ||
return State.bind( | ||
State.mapM(ppSomeCol, s.cols), | ||
row2m => { | ||
const row2 = row2m.join(", "); | ||
return State.bind( | ||
State.mapM(ppRow, s.params), | ||
rows2 => State.bind( | ||
freshQueryName(), | ||
qn => State.pure( | ||
" FROM (SELECT " | ||
+ ([row2].concat(rows2)).join(" UNION ALL SELECT ") | ||
+ ") AS " | ||
+ qn | ||
) | ||
) | ||
); | ||
} | ||
); | ||
case "Join": | ||
@@ -459,2 +487,13 @@ return State.bind( | ||
function ppRow(xs: SomeCol<SQL>[]): PP<string> { | ||
const pps: PP<string>[] = []; | ||
for (const x of xs) { | ||
pps.push(ppLit((<Exp.ELit>x.exp).lit)); | ||
} | ||
return State.bind( | ||
State.sequence(pps), | ||
ls => State.pure(ls.join(", ")) | ||
); | ||
} | ||
function ppRestricts(rs: Exp<SQL, boolean>[]): PP<string> { | ||
@@ -461,0 +500,0 @@ if (rs.length === 0) { |
@@ -5,3 +5,3 @@ export { ColName, TableName } from "./Types"; | ||
export { declareTable, TableDeclareCols, Table, ColInfo } from "./Table"; | ||
export { nullCol, numberCol, textCol, booleanCol, Col } from "./Column"; | ||
export { nullCol, numberCol, textCol, booleanCol, Col, ifThenElse, matchNullable } from "./Column"; | ||
export { update, updateReturning } from "./Update"; | ||
@@ -12,3 +12,3 @@ export { insertReturning, insert, insertOnConflictDoNothingReturning, insertOnConflictDoNothing, insertOnConflictDoUpdateReturning, insertOnConflictDoUpdate, insertManyReturning, insertMany, insertManyOnConflictDoNothingReturning, insertManyOnConflictDoNothing, insertManyOnConflictDoUpdateReturning, insertManyOnConflictDoUpdate } from "./Insert"; | ||
export { pg } from "./pg"; | ||
export { query, restrict, groupBy, aggregate, inQuery, exists, Arbitrary, arbitrary, leftJoin, innerJoin, inner, suchThat, select, limit, order, Q } from "./Imperative"; | ||
export { query, restrict, groupBy, aggregate, inQuery, exists, Arbitrary, arbitrary, leftJoin, innerJoin, inner, suchThat, select, selectValues, limit, order, Q } from "./Imperative"; | ||
export { isNull, isNotNull, not, restrictEq, like, ilike } from "./Operators"; | ||
@@ -15,0 +15,0 @@ export { e } from "./e"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6179463
11152