Skip to content

Commit 27c6a38

Browse files
PostgreSQL + SQLite support is stabilized,
identifiers like table name + column name + alias are parameterized + made case-sensitive for PostgreSQL + SQLite by quoting them in double quotes, upsert is patched for PostgreSQL and SQLite, code optimized to use string interpolation instead of concatenation, like + in prefixes and suffixes combined into 1 object look up function 'prefix', join object 'using' property optimized to handle placeholders and names, prepSubStr + prepPadding functions created for better code reusability and maintainability, replace property keywork 'with' renamed to 'replaceWith' for better understanding and readability, cast wrapper in prepNumeric moved to outer level to support casting into decimal etc after mathematical operations are done, prepName helper optimized for better code execution, prepPlaceholder helper optimized to support wrapping column names in double quotations, ctx patched to all prepName invocations to support wrapping column names in double quotes, code cleanup
1 parent cbc7f73 commit 27c6a38

File tree

6 files changed

+242
-261
lines changed

6 files changed

+242
-261
lines changed

defs/types.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
* @prop {EncryptionConfig} [decrypt]
7575
* @prop {boolean} [reverse]
7676
* @prop {'upper'|'lower'} [textCase]
77+
* @prop {{target:string, replaceWith:string}} [replace]
7778
* @prop {{left?:{length:number, pattern:string}, right?:{length:number, pattern:string}}} [padding]
7879
* @prop {{start:number, length:number}} [substr]
7980
* @prop {'left'|'right'|boolean} [trim]
@@ -88,7 +89,7 @@
8889
* @prop {number|string} value
8990
* @prop {EncryptionConfig} [decrypt]
9091
* @prop {EncryptionConfig} [encrypt]
91-
* @prop {EncryptionConfig} [decimals]
92+
* @prop {'floor'|'ceil'|'round'|number} [decimals]
9293
* @prop {number|string} [sub]
9394
* @prop {number|string} [add]
9495
* @prop {number|string} [power]
@@ -206,7 +207,7 @@
206207
* @typedef {Object} JoinQuery
207208
* @prop {SelectObject} [select]
208209
* @prop {'left'|'right'|'inner'|'fullOuter'|'cross'} [type]
209-
* @prop {(string|{[column:string]:string})[]} using
210+
* @prop {string[]|{[column:string]:string}} using
210211
* @typedef {PartialQuery & JoinQuery} BaseJoin
211212
*/
212213

@@ -222,9 +223,14 @@
222223
* @prop {BaseJson} [json]
223224
* @prop {BaseJson} [array]
224225
* @prop {BaseQuery} [refer]
225-
* @prop {BetweenObject} [between]
226+
*/
227+
228+
/**
229+
* composite methods
230+
* @typedef {Object} CompositeMethods
226231
* @prop {(WrapperMethods|AggregateWrappers|CustomWrapper)[]} [and]
227232
* @prop {(WrapperMethods|AggregateWrappers|CustomWrapper)[]} [or]
233+
* @prop {BetweenObject} [between]
228234
*/
229235

230236
/**
@@ -255,7 +261,7 @@
255261

256262
/**
257263
* where object
258-
* @typedef {(CustomWrapper|WrapperMethods)} WhereObject
264+
* @typedef {(CustomWrapper|WrapperMethods|CompositeMethods)} WhereObject
259265
*/
260266

261267
/**

0 commit comments

Comments
 (0)