taon-type-sql 21.0.68 → 21.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERIFIED-BUILD-DATA.jsonc +3 -3
- package/browser/package.json +1 -1
- package/browser-prod/package.json +1 -1
- package/full-dts/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/package.json +1 -1
- package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib-esm/lib/build-info._auto-generated_.js +1 -1
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/package.json +1 -1
- package/package.json +1 -1
- package/ts-source/browser-code/build-info._auto-generated_.ts +13 -0
- package/ts-source/browser-code/builder/column/basic-column.ts +19 -0
- package/ts-source/browser-code/builder/column/boolean-column.ts +20 -0
- package/ts-source/browser-code/builder/column/comparable-column.ts +47 -0
- package/ts-source/browser-code/builder/column/date-column.ts +20 -0
- package/ts-source/browser-code/builder/column/number-column.ts +25 -0
- package/ts-source/browser-code/builder/column/query-column.ts +28 -0
- package/ts-source/browser-code/builder/column/string-column.ts +42 -0
- package/ts-source/browser-code/builder/column/value-column.ts +39 -0
- package/ts-source/browser-code/builder/condition/query-column-condition.ts +29 -0
- package/ts-source/browser-code/builder/condition/query-condition-chain.ts +39 -0
- package/ts-source/browser-code/builder/condition/query-condition.ts +14 -0
- package/ts-source/browser-code/builder/condition/query-join-condition.ts +28 -0
- package/ts-source/browser-code/builder/helpers/generics-helper.ts +9 -0
- package/ts-source/browser-code/builder/helpers/internal-types.ts +22 -0
- package/ts-source/browser-code/builder/join/joined-tables-chain.ts +17 -0
- package/ts-source/browser-code/builder/join/joined-tables.ts +25 -0
- package/ts-source/browser-code/builder/other/query-ordering.ts +26 -0
- package/ts-source/browser-code/builder/query/select-query.ts +60 -0
- package/ts-source/browser-code/builder/query/table-condition-query.ts +31 -0
- package/ts-source/browser-code/builder/query/table-query.ts +63 -0
- package/ts-source/browser-code/builder/query-source.ts +29 -0
- package/ts-source/browser-code/builder/query-table.ts +29 -0
- package/ts-source/browser-code/client/mysql.ts +14 -0
- package/ts-source/browser-code/client/pg.ts +14 -0
- package/ts-source/browser-code/client/query-processor.ts +60 -0
- package/ts-source/browser-code/converter/param-converter.ts +31 -0
- package/ts-source/browser-code/converter/parameterized-converter.ts +22 -0
- package/ts-source/browser-code/converter/query-converter.ts +287 -0
- package/ts-source/browser-code/converter/result-converter.ts +93 -0
- package/ts-source/browser-code/converter/sql-converter.ts +13 -0
- package/ts-source/browser-code/converter/type-converter.ts +43 -0
- package/ts-source/browser-code/converter/types.ts +12 -0
- package/ts-source/browser-code/index._auto-generated_.ts +7 -0
- package/ts-source/browser-code/index.scss +6 -0
- package/ts-source/browser-code/index.ts +32 -0
- package/ts-source/browser-code/lib-info.md +8 -0
- package/ts-source/browser-code/migrations/index.ts +8 -0
- package/ts-source/browser-code/migrations/migrations-info.md +6 -0
- package/ts-source/browser-code/migrations/migrations_index._auto-generated_.ts +7 -0
- package/ts-source/browser-code-prod/build-info._auto-generated_.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/build-info._auto-generated_.ts +13 -0
- package/ts-source/browser-code-prod/builder/column/basic-column.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/column/basic-column.ts +19 -0
- package/ts-source/browser-code-prod/builder/column/boolean-column.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/column/boolean-column.ts +20 -0
- package/ts-source/browser-code-prod/builder/column/comparable-column.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/column/comparable-column.ts +47 -0
- package/ts-source/browser-code-prod/builder/column/date-column.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/column/date-column.ts +20 -0
- package/ts-source/browser-code-prod/builder/column/number-column.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/column/number-column.ts +25 -0
- package/ts-source/browser-code-prod/builder/column/query-column.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/column/query-column.ts +28 -0
- package/ts-source/browser-code-prod/builder/column/string-column.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/column/string-column.ts +42 -0
- package/ts-source/browser-code-prod/builder/column/value-column.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/column/value-column.ts +39 -0
- package/ts-source/browser-code-prod/builder/condition/query-column-condition.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/condition/query-column-condition.ts +29 -0
- package/ts-source/browser-code-prod/builder/condition/query-condition-chain.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/condition/query-condition-chain.ts +39 -0
- package/ts-source/browser-code-prod/builder/condition/query-condition.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/condition/query-condition.ts +14 -0
- package/ts-source/browser-code-prod/builder/condition/query-join-condition.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/condition/query-join-condition.ts +28 -0
- package/ts-source/browser-code-prod/builder/helpers/generics-helper.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/helpers/generics-helper.ts +9 -0
- package/ts-source/browser-code-prod/builder/helpers/internal-types.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/helpers/internal-types.ts +22 -0
- package/ts-source/browser-code-prod/builder/join/joined-tables-chain.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/join/joined-tables-chain.ts +17 -0
- package/ts-source/browser-code-prod/builder/join/joined-tables.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/join/joined-tables.ts +25 -0
- package/ts-source/browser-code-prod/builder/other/query-ordering.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/other/query-ordering.ts +26 -0
- package/ts-source/browser-code-prod/builder/query/select-query.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/query/select-query.ts +60 -0
- package/ts-source/browser-code-prod/builder/query/table-condition-query.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/query/table-condition-query.ts +31 -0
- package/ts-source/browser-code-prod/builder/query/table-query.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/query/table-query.ts +63 -0
- package/ts-source/browser-code-prod/builder/query-source.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/query-source.ts +29 -0
- package/ts-source/browser-code-prod/builder/query-table.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/builder/query-table.ts +29 -0
- package/ts-source/browser-code-prod/client/mysql.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/client/mysql.ts +14 -0
- package/ts-source/browser-code-prod/client/pg.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/client/pg.ts +14 -0
- package/ts-source/browser-code-prod/client/query-processor.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/client/query-processor.ts +60 -0
- package/ts-source/browser-code-prod/converter/param-converter.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/converter/param-converter.ts +31 -0
- package/ts-source/browser-code-prod/converter/parameterized-converter.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/converter/parameterized-converter.ts +22 -0
- package/ts-source/browser-code-prod/converter/query-converter.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/converter/query-converter.ts +287 -0
- package/ts-source/browser-code-prod/converter/result-converter.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/converter/result-converter.ts +93 -0
- package/ts-source/browser-code-prod/converter/sql-converter.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/converter/sql-converter.ts +13 -0
- package/ts-source/browser-code-prod/converter/type-converter.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/converter/type-converter.ts +43 -0
- package/ts-source/browser-code-prod/converter/types.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/converter/types.ts +12 -0
- package/ts-source/browser-code-prod/index._auto-generated_.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/index._auto-generated_.ts +7 -0
- package/ts-source/browser-code-prod/index.scss +6 -0
- package/ts-source/browser-code-prod/index.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/index.ts +32 -0
- package/ts-source/browser-code-prod/lib-info.md +8 -0
- package/ts-source/browser-code-prod/migrations/index.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/migrations/index.ts +8 -0
- package/ts-source/browser-code-prod/migrations/migrations-info.md +6 -0
- package/ts-source/browser-code-prod/migrations/migrations_index._auto-generated_.split-namespaces.json +4 -0
- package/ts-source/browser-code-prod/migrations/migrations_index._auto-generated_.ts +7 -0
- package/ts-source/websql-code/build-info._auto-generated_.ts +13 -0
- package/ts-source/websql-code/builder/column/basic-column.ts +19 -0
- package/ts-source/websql-code/builder/column/boolean-column.ts +20 -0
- package/ts-source/websql-code/builder/column/comparable-column.ts +47 -0
- package/ts-source/websql-code/builder/column/date-column.ts +20 -0
- package/ts-source/websql-code/builder/column/number-column.ts +25 -0
- package/ts-source/websql-code/builder/column/query-column.ts +28 -0
- package/ts-source/websql-code/builder/column/string-column.ts +42 -0
- package/ts-source/websql-code/builder/column/value-column.ts +39 -0
- package/ts-source/websql-code/builder/condition/query-column-condition.ts +29 -0
- package/ts-source/websql-code/builder/condition/query-condition-chain.ts +39 -0
- package/ts-source/websql-code/builder/condition/query-condition.ts +14 -0
- package/ts-source/websql-code/builder/condition/query-join-condition.ts +28 -0
- package/ts-source/websql-code/builder/helpers/generics-helper.ts +9 -0
- package/ts-source/websql-code/builder/helpers/internal-types.ts +22 -0
- package/ts-source/websql-code/builder/join/joined-tables-chain.ts +17 -0
- package/ts-source/websql-code/builder/join/joined-tables.ts +25 -0
- package/ts-source/websql-code/builder/other/query-ordering.ts +26 -0
- package/ts-source/websql-code/builder/query/select-query.ts +60 -0
- package/ts-source/websql-code/builder/query/table-condition-query.ts +31 -0
- package/ts-source/websql-code/builder/query/table-query.ts +63 -0
- package/ts-source/websql-code/builder/query-source.ts +29 -0
- package/ts-source/websql-code/builder/query-table.ts +29 -0
- package/ts-source/websql-code/client/mysql.ts +14 -0
- package/ts-source/websql-code/client/pg.ts +14 -0
- package/ts-source/websql-code/client/query-processor.ts +60 -0
- package/ts-source/websql-code/converter/param-converter.ts +31 -0
- package/ts-source/websql-code/converter/parameterized-converter.ts +22 -0
- package/ts-source/websql-code/converter/query-converter.ts +287 -0
- package/ts-source/websql-code/converter/result-converter.ts +93 -0
- package/ts-source/websql-code/converter/sql-converter.ts +13 -0
- package/ts-source/websql-code/converter/type-converter.ts +43 -0
- package/ts-source/websql-code/converter/types.ts +12 -0
- package/ts-source/websql-code/index._auto-generated_.ts +7 -0
- package/ts-source/websql-code/index.scss +6 -0
- package/ts-source/websql-code/index.ts +32 -0
- package/ts-source/websql-code/lib-info.md +8 -0
- package/ts-source/websql-code/migrations/index.ts +8 -0
- package/ts-source/websql-code/migrations/migrations-info.md +6 -0
- package/ts-source/websql-code/migrations/migrations_index._auto-generated_.ts +7 -0
- package/ts-source/websql-code-prod/build-info._auto-generated_.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/build-info._auto-generated_.ts +13 -0
- package/ts-source/websql-code-prod/builder/column/basic-column.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/column/basic-column.ts +19 -0
- package/ts-source/websql-code-prod/builder/column/boolean-column.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/column/boolean-column.ts +20 -0
- package/ts-source/websql-code-prod/builder/column/comparable-column.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/column/comparable-column.ts +47 -0
- package/ts-source/websql-code-prod/builder/column/date-column.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/column/date-column.ts +20 -0
- package/ts-source/websql-code-prod/builder/column/number-column.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/column/number-column.ts +25 -0
- package/ts-source/websql-code-prod/builder/column/query-column.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/column/query-column.ts +28 -0
- package/ts-source/websql-code-prod/builder/column/string-column.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/column/string-column.ts +42 -0
- package/ts-source/websql-code-prod/builder/column/value-column.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/column/value-column.ts +39 -0
- package/ts-source/websql-code-prod/builder/condition/query-column-condition.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/condition/query-column-condition.ts +29 -0
- package/ts-source/websql-code-prod/builder/condition/query-condition-chain.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/condition/query-condition-chain.ts +39 -0
- package/ts-source/websql-code-prod/builder/condition/query-condition.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/condition/query-condition.ts +14 -0
- package/ts-source/websql-code-prod/builder/condition/query-join-condition.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/condition/query-join-condition.ts +28 -0
- package/ts-source/websql-code-prod/builder/helpers/generics-helper.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/helpers/generics-helper.ts +9 -0
- package/ts-source/websql-code-prod/builder/helpers/internal-types.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/helpers/internal-types.ts +22 -0
- package/ts-source/websql-code-prod/builder/join/joined-tables-chain.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/join/joined-tables-chain.ts +17 -0
- package/ts-source/websql-code-prod/builder/join/joined-tables.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/join/joined-tables.ts +25 -0
- package/ts-source/websql-code-prod/builder/other/query-ordering.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/other/query-ordering.ts +26 -0
- package/ts-source/websql-code-prod/builder/query/select-query.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/query/select-query.ts +60 -0
- package/ts-source/websql-code-prod/builder/query/table-condition-query.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/query/table-condition-query.ts +31 -0
- package/ts-source/websql-code-prod/builder/query/table-query.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/query/table-query.ts +63 -0
- package/ts-source/websql-code-prod/builder/query-source.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/query-source.ts +29 -0
- package/ts-source/websql-code-prod/builder/query-table.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/builder/query-table.ts +29 -0
- package/ts-source/websql-code-prod/client/mysql.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/client/mysql.ts +14 -0
- package/ts-source/websql-code-prod/client/pg.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/client/pg.ts +14 -0
- package/ts-source/websql-code-prod/client/query-processor.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/client/query-processor.ts +60 -0
- package/ts-source/websql-code-prod/converter/param-converter.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/converter/param-converter.ts +31 -0
- package/ts-source/websql-code-prod/converter/parameterized-converter.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/converter/parameterized-converter.ts +22 -0
- package/ts-source/websql-code-prod/converter/query-converter.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/converter/query-converter.ts +287 -0
- package/ts-source/websql-code-prod/converter/result-converter.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/converter/result-converter.ts +93 -0
- package/ts-source/websql-code-prod/converter/sql-converter.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/converter/sql-converter.ts +13 -0
- package/ts-source/websql-code-prod/converter/type-converter.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/converter/type-converter.ts +43 -0
- package/ts-source/websql-code-prod/converter/types.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/converter/types.ts +12 -0
- package/ts-source/websql-code-prod/index._auto-generated_.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/index._auto-generated_.ts +7 -0
- package/ts-source/websql-code-prod/index.scss +6 -0
- package/ts-source/websql-code-prod/index.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/index.ts +32 -0
- package/ts-source/websql-code-prod/lib-info.md +8 -0
- package/ts-source/websql-code-prod/migrations/index.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/migrations/index.ts +8 -0
- package/ts-source/websql-code-prod/migrations/migrations-info.md +6 -0
- package/ts-source/websql-code-prod/migrations/migrations_index._auto-generated_.split-namespaces.json +4 -0
- package/ts-source/websql-code-prod/migrations/migrations_index._auto-generated_.ts +7 -0
- package/websql/package.json +1 -1
- package/websql-prod/package.json +1 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import { QueryEngine } from "./types";
|
|
9
|
+
export function convertResult(query: any, result: any, engine: QueryEngine): any {
|
|
10
|
+
let rows = engine === 'pg' ? result.rows : result;
|
|
11
|
+
let rowCount = engine === 'pg' ? result.rowCount : result.affectedRows || result.changedRows;
|
|
12
|
+
if (query._action === 'select')
|
|
13
|
+
return convertSelectResult(query, rows);
|
|
14
|
+
if (query._action === 'delete')
|
|
15
|
+
return rowCount;
|
|
16
|
+
if (query._action === 'update')
|
|
17
|
+
return rowCount;
|
|
18
|
+
if (query._action === 'insert')
|
|
19
|
+
return convertInsertResult(result, engine);
|
|
20
|
+
throw new Error('Unknown query type:' + query._action);
|
|
21
|
+
}
|
|
22
|
+
function convertInsertResult(result: any, engine: QueryEngine): any {
|
|
23
|
+
if (engine === 'mysql')
|
|
24
|
+
return result.insertId > 0 ? result.insertId : undefined;
|
|
25
|
+
if (engine === 'pg' && result.rows && result.rows.length === 1) {
|
|
26
|
+
let columnName = Object.keys(result.rows[0])[0];
|
|
27
|
+
return result.rows[0][columnName];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function convertSelectResult(query: any, rows: any[]): any {
|
|
31
|
+
if (query._columns && query._columns.length === 1 &&
|
|
32
|
+
!(query._columns[0]._name === '*' && query._columns[0]._modifiers.length === 0)) {
|
|
33
|
+
if (rows.length == 0)
|
|
34
|
+
return [];
|
|
35
|
+
let columnName = Object.keys(rows[0])[0];
|
|
36
|
+
let values = rows.map((row: any) => row[columnName]);
|
|
37
|
+
if (query._columns[0]._name === '*' && query._columns[0]._modifiers.some((m: any) => m.name === 'count')) {
|
|
38
|
+
return values.map((value: any) => Number(value));
|
|
39
|
+
}
|
|
40
|
+
return values;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
convertAliasFields(query, rows);
|
|
44
|
+
return rows;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function convertAliasFields(query: any, rows: any[]): void {
|
|
48
|
+
let aliasByName = getColumnAliasesByName(query);
|
|
49
|
+
if (Object.keys(aliasByName).length === 0)
|
|
50
|
+
return;
|
|
51
|
+
rows.forEach((row: any) => {
|
|
52
|
+
Object.keys(row).forEach((name: string) => {
|
|
53
|
+
if (aliasByName[name]) {
|
|
54
|
+
row[aliasByName[name]] = row[name];
|
|
55
|
+
delete row[name];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function getColumnAliasesByName(query: any): any {
|
|
61
|
+
let aliasByName = {} as any;
|
|
62
|
+
if (query._columns && query._columns.length > 0) {
|
|
63
|
+
query._columns.forEach((column: any) => {
|
|
64
|
+
if (column._name && column._name.alias && column._modifiers.length === 0) {
|
|
65
|
+
aliasByName[column._name.name] = column._name.alias;
|
|
66
|
+
}
|
|
67
|
+
else if (column._name === '*' && column._modifiers.length === 0) {
|
|
68
|
+
getAliasColumnsOfTable(column._table).forEach((column: any) => {
|
|
69
|
+
aliasByName[column._name.name] = column._name.alias;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
let tables = query._table ? [query._table] : query._tables;
|
|
76
|
+
tables.forEach((table: any) => {
|
|
77
|
+
getAliasColumnsOfTable(table).forEach((column: any) => {
|
|
78
|
+
aliasByName[column._name.name] = column._name.alias;
|
|
79
|
+
});
|
|
80
|
+
let joinTable = table._parent;
|
|
81
|
+
while (joinTable) {
|
|
82
|
+
getAliasColumnsOfTable(joinTable).forEach((column: any) => {
|
|
83
|
+
aliasByName[column._name.name] = column._name.alias;
|
|
84
|
+
});
|
|
85
|
+
joinTable = joinTable._parent;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return aliasByName;
|
|
90
|
+
}
|
|
91
|
+
function getAliasColumnsOfTable(table: any): any[] {
|
|
92
|
+
return Object.keys(table).map(key => table[key]).filter((column: any) => column && column._name && column._name.alias);
|
|
93
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import { createQueryConverter } from "./query-converter";
|
|
9
|
+
import { convertSubstitutionParam } from './param-converter';
|
|
10
|
+
import { QueryEngine, ConverterOptions } from "./types";
|
|
11
|
+
export function convertQueryToSQL(query: any, options: ConverterOptions, engine: QueryEngine): string {
|
|
12
|
+
return createQueryConverter((param: any) => convertSubstitutionParam(param), options, engine)(query);
|
|
13
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
export function number(param: any): number {
|
|
9
|
+
let result = Number(param);
|
|
10
|
+
if (Number.isNaN(result))
|
|
11
|
+
throw new Error('Invalid number parameter in SQL query: ' + param);
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
export function boolean(param: any): boolean {
|
|
15
|
+
if (typeof param === 'boolean')
|
|
16
|
+
return param;
|
|
17
|
+
if (param instanceof Boolean)
|
|
18
|
+
return param.valueOf();
|
|
19
|
+
if (param === 'true')
|
|
20
|
+
return true;
|
|
21
|
+
if (param === 'false')
|
|
22
|
+
return false;
|
|
23
|
+
throw new Error('Invalid boolean parameter in SQL query: ' + param);
|
|
24
|
+
}
|
|
25
|
+
export function date(param: any): Date {
|
|
26
|
+
if (param instanceof Date)
|
|
27
|
+
return param;
|
|
28
|
+
if (typeof param === 'number' || param instanceof Number)
|
|
29
|
+
return new Date(param);
|
|
30
|
+
if (typeof param === 'string' || param instanceof String) {
|
|
31
|
+
if (Number.isNaN(Date.parse(String(param))))
|
|
32
|
+
throw new Error('Invalid date parameter in SQL query: ' + param);
|
|
33
|
+
return new Date(param);
|
|
34
|
+
}
|
|
35
|
+
throw new Error('Invalid date parameter in SQL query: ' + param);
|
|
36
|
+
}
|
|
37
|
+
export function string(param: any): string {
|
|
38
|
+
if (typeof param === 'string')
|
|
39
|
+
return param;
|
|
40
|
+
if (param instanceof String)
|
|
41
|
+
return param.valueOf();
|
|
42
|
+
throw new Error('Invalid string parameter in SQL query: ' + param);
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
export type QueryEngine = 'pg' | 'mysql';
|
|
9
|
+
export interface ConverterOptions {
|
|
10
|
+
lineBreak: string;
|
|
11
|
+
nameEscape: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
export { default as BasicColumn } from './builder/column/basic-column';
|
|
9
|
+
export { default as BooleanColumn } from './builder/column/boolean-column';
|
|
10
|
+
export { default as ComparableColumn } from './builder/column/comparable-column';
|
|
11
|
+
export { default as DateColumn } from './builder/column/date-column';
|
|
12
|
+
export { default as NumberColumn } from './builder/column/number-column';
|
|
13
|
+
export { default as QueryColumn } from './builder/column/query-column';
|
|
14
|
+
export { default as StringColumn } from './builder/column/string-column';
|
|
15
|
+
export { default as ValueColumn } from './builder/column/value-column';
|
|
16
|
+
export { default as QueryColumnCondition } from './builder/condition/query-column-condition';
|
|
17
|
+
export { default as QueryCondition } from './builder/condition/query-condition';
|
|
18
|
+
export { default as QueryConditionChain } from './builder/condition/query-condition-chain';
|
|
19
|
+
export { default as QueryJoinCondition } from './builder/condition/query-join-condition';
|
|
20
|
+
export { default as JoinedTables } from './builder/join/joined-tables';
|
|
21
|
+
export { default as JoinedTablesChain } from './builder/join/joined-tables-chain';
|
|
22
|
+
export { default as QueryOrdering } from './builder/other/query-ordering';
|
|
23
|
+
export { default as SelectQuery } from './builder/query/select-query';
|
|
24
|
+
export { default as TableQuery } from './builder/query/table-query';
|
|
25
|
+
export { default as TableConditionQuery } from './builder/query/table-condition-query';
|
|
26
|
+
export { default as QuerySource } from './builder/query-source';
|
|
27
|
+
export { default as QueryTable } from './builder/query-table';
|
|
28
|
+
export { default as MySqlQuerySource } from './client/mysql';
|
|
29
|
+
export { QueryProcessorOptions } from './client/query-processor';
|
|
30
|
+
export type PropsEntitySQL<IEntityType> = {
|
|
31
|
+
[prop in keyof Required<IEntityType>]: any;
|
|
32
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
export * from './migrations_index._auto-generated_';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
export const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
|
|
9
|
+
export const APP_ID = 'com.domain.example.taon-type-sql';
|
|
10
|
+
export const BUILD_BASE_HREF = '';
|
|
11
|
+
export const PROJECT_NPM_NAME = 'taon-type-sql';
|
|
12
|
+
export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
|
|
13
|
+
export const CURRENT_PACKAGE_VERSION = '21.0.69';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import QueryTable from "../query-table";
|
|
9
|
+
import QueryColumn from "./query-column";
|
|
10
|
+
import NumberColumn from "./number-column";
|
|
11
|
+
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
12
|
+
export default class BasicColumn<Table extends QueryTable<any, any>, T> extends QueryColumn<Table, T> {
|
|
13
|
+
constructor(table: Table, name: ColumnName, modifiers: ColumnModifier[] = []) {
|
|
14
|
+
super(table, name, modifiers);
|
|
15
|
+
}
|
|
16
|
+
count(): NumberColumn<Table> {
|
|
17
|
+
return new NumberColumn(this._table, this._name, this._modifiers.concat({ name: 'count' }));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import QueryTable from "../query-table";
|
|
9
|
+
import NumberColumn from "./number-column";
|
|
10
|
+
import ValueColumn from "./value-column";
|
|
11
|
+
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
12
|
+
export default class BooleanColumn<Table extends QueryTable<any, any>> extends ValueColumn<Table, boolean> {
|
|
13
|
+
protected _type = 'boolean';
|
|
14
|
+
constructor(table: Table, name: ColumnName, modifiers: ColumnModifier[] = []) {
|
|
15
|
+
super(table, name, modifiers);
|
|
16
|
+
}
|
|
17
|
+
count(): NumberColumn<Table> {
|
|
18
|
+
return new NumberColumn(this._table, this._name, this._modifiers.concat({ name: 'count' }));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import QueryColumnCondition from "../condition/query-column-condition";
|
|
9
|
+
import QueryTable from "../query-table";
|
|
10
|
+
import ValueColumn from "./value-column";
|
|
11
|
+
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
12
|
+
abstract class ComparableColumn<Table extends QueryTable<any, any>, T> extends ValueColumn<Table, T> {
|
|
13
|
+
constructor(table: Table, name: ColumnName, modifiers: ColumnModifier[] = []) {
|
|
14
|
+
super(table, name, modifiers);
|
|
15
|
+
}
|
|
16
|
+
lt(value: T) {
|
|
17
|
+
return new QueryColumnCondition<Table, T>(this, 'lt', value);
|
|
18
|
+
}
|
|
19
|
+
gt(value: T) {
|
|
20
|
+
return new QueryColumnCondition<Table, T>(this, 'gt', value);
|
|
21
|
+
}
|
|
22
|
+
lte(value: T) {
|
|
23
|
+
return new QueryColumnCondition<Table, T>(this, 'lte', value);
|
|
24
|
+
}
|
|
25
|
+
gte(value: T) {
|
|
26
|
+
return new QueryColumnCondition<Table, T>(this, 'gte', value);
|
|
27
|
+
}
|
|
28
|
+
in(values: T[]) {
|
|
29
|
+
return new QueryColumnCondition<Table, T>(this, 'in', ...values);
|
|
30
|
+
}
|
|
31
|
+
notIn(values: T[]) {
|
|
32
|
+
return new QueryColumnCondition<Table, T>(this, 'not-in', ...values);
|
|
33
|
+
}
|
|
34
|
+
between(value1: T, value2: T) {
|
|
35
|
+
return new QueryColumnCondition<Table, T>(this, 'between', value1, value2);
|
|
36
|
+
}
|
|
37
|
+
notBetween(value1: T, value2: T) {
|
|
38
|
+
return new QueryColumnCondition<Table, T>(this, 'not-between', value1, value2);
|
|
39
|
+
}
|
|
40
|
+
min(): this {
|
|
41
|
+
return new (<any>this.constructor)(this._table, this._name, this._modifiers.concat({ name: 'min' }));
|
|
42
|
+
}
|
|
43
|
+
max(): this {
|
|
44
|
+
return new (<any>this.constructor)(this._table, this._name, this._modifiers.concat({ name: 'max' }));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export default ComparableColumn;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import QueryTable from "../query-table";
|
|
9
|
+
import ComparableColumn from "./comparable-column";
|
|
10
|
+
import NumberColumn from "./number-column";
|
|
11
|
+
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
12
|
+
export default class DateColumn<Table extends QueryTable<any, any>> extends ComparableColumn<Table, Date> {
|
|
13
|
+
protected _type = 'date';
|
|
14
|
+
constructor(table: Table, name: ColumnName, modifiers: ColumnModifier[] = []) {
|
|
15
|
+
super(table, name, modifiers);
|
|
16
|
+
}
|
|
17
|
+
count(): NumberColumn<Table> {
|
|
18
|
+
return new NumberColumn(this._table, this._name, this._modifiers.concat({ name: 'count' }));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import QueryTable from "../query-table";
|
|
9
|
+
import ComparableColumn from "./comparable-column";
|
|
10
|
+
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
11
|
+
export default class NumberColumn<Table extends QueryTable<any, any>> extends ComparableColumn<Table, number> {
|
|
12
|
+
protected _type = 'number';
|
|
13
|
+
constructor(table: Table, name: ColumnName, modifiers: ColumnModifier[] = []) {
|
|
14
|
+
super(table, name, modifiers);
|
|
15
|
+
}
|
|
16
|
+
count(): NumberColumn<Table> {
|
|
17
|
+
return new NumberColumn(this._table, this._name, this._modifiers.concat({ name: 'count' }));
|
|
18
|
+
}
|
|
19
|
+
sum(): NumberColumn<Table> {
|
|
20
|
+
return new NumberColumn<Table>(this._table, this._name, this._modifiers.concat({ name: 'sum' }));
|
|
21
|
+
}
|
|
22
|
+
avg(): NumberColumn<Table> {
|
|
23
|
+
return new NumberColumn<Table>(this._table, this._name, this._modifiers.concat({ name: 'avg' }));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import QueryTable from "../query-table";
|
|
9
|
+
import NumberColumn from "./number-column";
|
|
10
|
+
import GenericsHelper from "../helpers/generics-helper";
|
|
11
|
+
import QueryColumnCondition from "../condition/query-column-condition";
|
|
12
|
+
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
13
|
+
abstract class QueryColumn<Table extends QueryTable<any, any>, T> {
|
|
14
|
+
protected _$type: GenericsHelper<T>;
|
|
15
|
+
protected _type: string;
|
|
16
|
+
constructor(protected _table: Table, protected _name: ColumnName, protected _modifiers: ColumnModifier[] = []) { }
|
|
17
|
+
abstract count(): NumberColumn<Table>;
|
|
18
|
+
as(alias: string): this {
|
|
19
|
+
return new (<any>this.constructor)(this._table, this._name, this._modifiers.concat({ name: 'as', params: alias }));
|
|
20
|
+
}
|
|
21
|
+
isNull() {
|
|
22
|
+
return new QueryColumnCondition<Table, T>(this, 'is-null');
|
|
23
|
+
}
|
|
24
|
+
isNotNull() {
|
|
25
|
+
return new QueryColumnCondition<Table, T>(this, 'is-not-null');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export default QueryColumn;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import QueryTable from "../query-table";
|
|
9
|
+
import ComparableColumn from "./comparable-column";
|
|
10
|
+
import NumberColumn from "./number-column";
|
|
11
|
+
import QueryColumnCondition from "../condition/query-column-condition";
|
|
12
|
+
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
13
|
+
export default class StringColumn<Table extends QueryTable<any, any>> extends ComparableColumn<Table, string> {
|
|
14
|
+
protected _type = 'string';
|
|
15
|
+
constructor(table: Table, name: ColumnName, modifiers: ColumnModifier[] = []) {
|
|
16
|
+
super(table, name, modifiers);
|
|
17
|
+
}
|
|
18
|
+
count(): NumberColumn<Table> {
|
|
19
|
+
return new NumberColumn(this._table, this._name, this._modifiers.concat({ name: 'count' }));
|
|
20
|
+
}
|
|
21
|
+
lower(): this {
|
|
22
|
+
return new (<any>this.constructor)(this._table, this._name, this._modifiers.concat({ name: 'lower' }));
|
|
23
|
+
}
|
|
24
|
+
upper(): this {
|
|
25
|
+
return new (<any>this.constructor)(this._table, this._name, this._modifiers.concat({ name: 'upper' }));
|
|
26
|
+
}
|
|
27
|
+
contains(value: string) {
|
|
28
|
+
return this.like('%' + value + '%');
|
|
29
|
+
}
|
|
30
|
+
startsWith(value: string) {
|
|
31
|
+
return this.like(value + '%');
|
|
32
|
+
}
|
|
33
|
+
endsWith(value: string) {
|
|
34
|
+
return this.like('%' + value);
|
|
35
|
+
}
|
|
36
|
+
like(value: string) {
|
|
37
|
+
return new QueryColumnCondition<Table, string>(this, 'like', value);
|
|
38
|
+
}
|
|
39
|
+
notLike(value: string) {
|
|
40
|
+
return new QueryColumnCondition<Table, string>(this, 'not-like', value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import QueryColumnCondition from "../condition/query-column-condition";
|
|
9
|
+
import QueryOrdering from "../other/query-ordering";
|
|
10
|
+
import QueryTable from "../query-table";
|
|
11
|
+
import QueryColumn from "./query-column";
|
|
12
|
+
import QueryCondition from "../condition/query-condition";
|
|
13
|
+
import QueryJoinCondition from "../condition/query-join-condition";
|
|
14
|
+
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
15
|
+
abstract class ValueColumn<Table extends QueryTable<any, any>, T> extends QueryColumn<Table, T> {
|
|
16
|
+
constructor(table: Table, name: ColumnName, modifiers: ColumnModifier[] = []) {
|
|
17
|
+
super(table, name, modifiers);
|
|
18
|
+
}
|
|
19
|
+
asc() {
|
|
20
|
+
return new QueryOrdering<Table>(this, 'ASC');
|
|
21
|
+
}
|
|
22
|
+
desc() {
|
|
23
|
+
return new QueryOrdering<Table>(this, 'DESC');
|
|
24
|
+
}
|
|
25
|
+
eq<Table2 extends QueryTable<any, any>>(value: QueryColumn<Table2, T>): QueryJoinCondition<Table, Table2, T>;
|
|
26
|
+
eq(value: T): QueryColumnCondition<Table, T>;
|
|
27
|
+
eq<Table2 extends QueryTable<any, any>>(value: any): QueryCondition<any> {
|
|
28
|
+
if (value instanceof QueryColumn) {
|
|
29
|
+
return new QueryJoinCondition<Table, Table2, T>(this, 'eq', value);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return new QueryColumnCondition<Table, T>(this, 'eq', value);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
ne(value: T) {
|
|
36
|
+
return new QueryColumnCondition<Table, T>(this, 'ne', value);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export default ValueColumn;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* TAON READONLY SOURCE
|
|
4
|
+
* DO NOT MODIFY THIS FILE.
|
|
5
|
+
* Changes may be overwritten.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import QueryColumn from "../column/query-column";
|
|
9
|
+
import QueryTable from "../query-table";
|
|
10
|
+
import QueryCondition from "./query-condition";
|
|
11
|
+
import QueryConditionChain from "./query-condition-chain";
|
|
12
|
+
import { ConditionType } from "../helpers/internal-types";
|
|
13
|
+
export default class QueryColumnCondition<Table extends QueryTable<any, any>, T> extends QueryCondition<Table> {
|
|
14
|
+
protected _column: QueryColumn<Table, T>;
|
|
15
|
+
protected _type: ConditionType;
|
|
16
|
+
protected _values: T[];
|
|
17
|
+
constructor(column: QueryColumn<Table, T>, type: ConditionType, ...values: T[]) {
|
|
18
|
+
super();
|
|
19
|
+
this._column = column;
|
|
20
|
+
this._type = type;
|
|
21
|
+
this._values = values;
|
|
22
|
+
}
|
|
23
|
+
and<Table2 extends QueryTable<any, any>>(condition: QueryCondition<Table2>): QueryConditionChain<Table | Table2> {
|
|
24
|
+
return new QueryConditionChain<Table | Table2>(this, condition, 'and');
|
|
25
|
+
}
|
|
26
|
+
or<Table2 extends QueryTable<any, any>>(condition: QueryCondition<Table2>): QueryConditionChain<Table | Table2> {
|
|
27
|
+
return new QueryConditionChain<Table | Table2>(this, condition, 'or');
|
|
28
|
+
}
|
|
29
|
+
}
|