taon-type-sql 21.0.22 → 21.0.24
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/browser/package.json +1 -1
- package/browser-prod/package.json +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-prod/{build-info._auto-generated_.ts → build-info._auto-generated_.js} +1 -2
- package/lib-prod/builder/column/{basic-column.ts → basic-column.js} +4 -10
- package/lib-prod/builder/column/boolean-column.js +11 -0
- package/lib-prod/builder/column/comparable-column.js +39 -0
- package/lib-prod/builder/column/date-column.js +11 -0
- package/lib-prod/builder/column/number-column.js +16 -0
- package/lib-prod/builder/column/query-column.js +18 -0
- package/lib-prod/builder/column/string-column.js +33 -0
- package/lib-prod/builder/column/value-column.js +27 -0
- package/lib-prod/builder/condition/query-column-condition.js +16 -0
- package/lib-prod/builder/condition/query-condition-chain.js +26 -0
- package/lib-prod/builder/condition/query-condition.js +4 -0
- package/lib-prod/builder/condition/query-join-condition.js +16 -0
- package/lib-prod/builder/helpers/{generics-helper.ts → generics-helper.js} +2 -1
- package/lib-prod/builder/helpers/internal-types.js +1 -0
- package/lib-prod/builder/join/joined-tables-chain.js +11 -0
- package/lib-prod/builder/join/joined-tables.js +19 -0
- package/lib-prod/builder/other/query-ordering.js +14 -0
- package/lib-prod/builder/query/select-query.js +45 -0
- package/lib-prod/builder/query/table-condition-query.js +22 -0
- package/lib-prod/builder/query/table-query.js +52 -0
- package/lib-prod/builder/query-source.js +17 -0
- package/lib-prod/builder/query-table.js +22 -0
- package/lib-prod/client/{mysql.ts → mysql.js} +3 -5
- package/lib-prod/client/{pg.ts → pg.js} +3 -5
- package/lib-prod/client/query-processor.js +69 -0
- package/lib-prod/converter/{param-converter.ts → param-converter.js} +11 -8
- package/lib-prod/converter/parameterized-converter.js +14 -0
- package/lib-prod/converter/{query-converter.ts → query-converter.js} +94 -110
- package/lib-prod/converter/result-converter.js +85 -0
- package/lib-prod/converter/sql-converter.js +5 -0
- package/lib-prod/converter/type-converter.js +36 -0
- package/lib-prod/converter/types.js +1 -0
- package/lib-prod/env/{env.angular-node-app.ts → env.angular-node-app.js} +1 -1
- package/lib-prod/env/{env.docs-webapp.ts → env.docs-webapp.js} +1 -1
- package/lib-prod/env/{env.electron-app.ts → env.electron-app.js} +1 -1
- package/lib-prod/env/{env.mobile-app.ts → env.mobile-app.js} +1 -1
- package/lib-prod/env/{env.npm-lib-and-cli-tool.ts → env.npm-lib-and-cli-tool.js} +1 -1
- package/lib-prod/env/{env.vscode-plugin.ts → env.vscode-plugin.js} +1 -1
- package/lib-prod/{index._auto-generated_.ts → index._auto-generated_.js} +1 -1
- package/lib-prod/{index.ts → index.js} +0 -12
- package/lib-prod/migrations/index.js +2 -0
- package/lib-prod/migrations/{migrations_index._auto-generated_.ts → migrations_index._auto-generated_.js} +0 -2
- package/lib-prod/package.json +1 -1
- package/package.json +1 -1
- package/websql/package.json +1 -1
- package/websql-prod/package.json +1 -1
- package/lib-prod/builder/column/boolean-column.ts +0 -19
- package/lib-prod/builder/column/comparable-column.ts +0 -56
- package/lib-prod/builder/column/date-column.ts +0 -19
- package/lib-prod/builder/column/number-column.ts +0 -25
- package/lib-prod/builder/column/query-column.ts +0 -34
- package/lib-prod/builder/column/string-column.ts +0 -47
- package/lib-prod/builder/column/value-column.ts +0 -39
- package/lib-prod/builder/condition/query-column-condition.ts +0 -28
- package/lib-prod/builder/condition/query-condition-chain.ts +0 -42
- package/lib-prod/builder/condition/query-condition.ts +0 -13
- package/lib-prod/builder/condition/query-join-condition.ts +0 -27
- package/lib-prod/builder/helpers/internal-types.ts +0 -31
- package/lib-prod/builder/join/joined-tables-chain.ts +0 -17
- package/lib-prod/builder/join/joined-tables.ts +0 -28
- package/lib-prod/builder/other/query-ordering.ts +0 -26
- package/lib-prod/builder/query/select-query.ts +0 -68
- package/lib-prod/builder/query/table-condition-query.ts +0 -35
- package/lib-prod/builder/query/table-query.ts +0 -72
- package/lib-prod/builder/query-source.ts +0 -25
- package/lib-prod/builder/query-table.ts +0 -34
- package/lib-prod/client/query-processor.ts +0 -89
- package/lib-prod/converter/parameterized-converter.ts +0 -20
- package/lib-prod/converter/result-converter.ts +0 -88
- package/lib-prod/converter/sql-converter.ts +0 -7
- package/lib-prod/converter/type-converter.ts +0 -29
- package/lib-prod/converter/types.ts +0 -6
- package/lib-prod/lib-info.md +0 -8
- package/lib-prod/migrations/index.ts +0 -2
- package/lib-prod/migrations/migrations-info.md +0 -6
- /package/lib-prod/env/{index.ts → index.js} +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import BasicColumn from "./column/basic-column";
|
|
2
|
-
import GenericsHelper from "./helpers/generics-helper";
|
|
3
|
-
import JoinedTablesChain from "./join/joined-tables-chain";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
abstract class QueryTable<Entity, Id> {
|
|
7
|
-
|
|
8
|
-
constructor(protected _$name: string) {}
|
|
9
|
-
|
|
10
|
-
protected _$type: GenericsHelper<Entity>;
|
|
11
|
-
protected _$idType: GenericsHelper<Id>;
|
|
12
|
-
|
|
13
|
-
// abstract readonly $id; // FIXME I got a dozen incomprehensible type errors
|
|
14
|
-
|
|
15
|
-
$all = new BasicColumn<this, Entity>(this, '*');
|
|
16
|
-
|
|
17
|
-
innerJoin<JoinTable extends QueryTable<any, any>>(table: JoinTable): JoinedTablesChain<this | JoinTable> {
|
|
18
|
-
return new JoinedTablesChain<this | JoinTable>(table, 'inner', this);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
leftJoin<JoinTable extends QueryTable<any, any>>(table: JoinTable): JoinedTablesChain<this | JoinTable> {
|
|
22
|
-
return new JoinedTablesChain<this | JoinTable>(table, 'left', this);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
rightJoin<JoinTable extends QueryTable<any, any>>(table: JoinTable): JoinedTablesChain<this | JoinTable> {
|
|
26
|
-
return new JoinedTablesChain<this | JoinTable>(table, 'right', this);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
fullJoin<JoinTable extends QueryTable<any, any>>(table: JoinTable): JoinedTablesChain<this | JoinTable> {
|
|
30
|
-
return new JoinedTablesChain<this | JoinTable>(table, 'full', this);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default QueryTable;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Log, Level } from 'ng2-logger/lib-prod';
|
|
2
|
-
import { convertQueryToParameterizedSQL } from '../converter/parameterized-converter';
|
|
3
|
-
import { convertQueryToSQL } from '../converter/sql-converter';
|
|
4
|
-
import { convertResult } from "../converter/result-converter";
|
|
5
|
-
import { QueryEngine, ConverterOptions } from '../converter/types';
|
|
6
|
-
import { QueryProcessor } from '../builder/helpers/internal-types';
|
|
7
|
-
import { Helpers__NS___fixCommand, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__compilationWrapper, Helpers__NS__contain, Helpers__NS__createFolder, Helpers__NS__createSymLink, Helpers__NS__error, Helpers__NS__execute, Helpers__NS__exists, Helpers__NS__filesFrom, Helpers__NS__foldersFrom, Helpers__NS__getFilesFrom, Helpers__NS__getFoldersFrom, Helpers__NS__getIsBrowser, Helpers__NS__getIsElectron, Helpers__NS__getIsNode, Helpers__NS__getIsRunningInGitBash, Helpers__NS__getIsSupportedTaonTerminal, Helpers__NS__getIsVerboseMode, Helpers__NS__getIsWebSQL, Helpers__NS__getIsWsl, Helpers__NS__getStdio, Helpers__NS__hideNodeWarnings, Helpers__NS__info, Helpers__NS__isBlob, Helpers__NS__isBuffer, Helpers__NS__isClass, Helpers__NS__isExistedSymlink, Helpers__NS__isFile, Helpers__NS__isFolder, Helpers__NS__isRunningInDocker, Helpers__NS__isRunningInLinuxGraphicsCapableEnvironment, Helpers__NS__isSymlinkFileExitedOrUnexisted, Helpers__NS__isSymlinkThatMatchesUrl, Helpers__NS__isUnexistedLink, Helpers__NS__killOnPort, Helpers__NS__killProcess, Helpers__NS__killProcessByPort, Helpers__NS__linksToFolderFrom, Helpers__NS__linksToFoldersFrom, Helpers__NS__log, Helpers__NS__logError, Helpers__NS__logInfo, Helpers__NS__logProc, Helpers__NS__logSuccess, Helpers__NS__logWarn, Helpers__NS__mediaTypeFromSrc, Helpers__NS__mkdirp, Helpers__NS__modifyLineByLine, Helpers__NS__msgCacheClear, Helpers__NS__openFolderInFileExplorer, Helpers__NS__parse, Helpers__NS__pathContainLink, Helpers__NS__questionYesNo, Helpers__NS__readFile, Helpers__NS__readJson, Helpers__NS__readJson5, Helpers__NS__readJsonC, Helpers__NS__relative, Helpers__NS__remove, Helpers__NS__removeEmptyLineFromString, Helpers__NS__removeFileIfExists, Helpers__NS__removeFolderIfExists, Helpers__NS__removeIfExists, Helpers__NS__removeSlashAtBegin, Helpers__NS__removeSlashAtEnd, Helpers__NS__removeSymlinks, Helpers__NS__renderError, Helpers__NS__replaceLinesInFile, Helpers__NS__run, Helpers__NS__runAsyncIn, Helpers__NS__runSyncIn, Helpers__NS__runSyncOrAsync, Helpers__NS__sleep, Helpers__NS__stopApplication, Helpers__NS__stringify, Helpers__NS__success, Helpers__NS__taskDone, Helpers__NS__taskStarted, Helpers__NS__throwError, Helpers__NS__timeout, Helpers__NS__tryCatchError, Helpers__NS__tryReadFile, Helpers__NS__tryRemoveDir, Helpers__NS__values, Helpers__NS__wait, Helpers__NS__warn, Helpers__NS__writeFile, Helpers__NS__writeJson, Helpers__NS__writeJson5, Helpers__NS__writeJsonC } from 'tnp-core/lib-prod';
|
|
8
|
-
|
|
9
|
-
const log = Log.create('query processor',
|
|
10
|
-
// Level.__NOTHING
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
export interface QueryProcessorOptions {
|
|
14
|
-
lineBreaks?: boolean,
|
|
15
|
-
parameterized?: boolean,
|
|
16
|
-
logging?: boolean,
|
|
17
|
-
logger?: (sql: string, params?: any[]) => void,
|
|
18
|
-
identifierQuote?: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const DEFAULT_OPTIONS: QueryProcessorOptions = {
|
|
22
|
-
lineBreaks: false,
|
|
23
|
-
parameterized: true,
|
|
24
|
-
logging: true,
|
|
25
|
-
identifierQuote: '"'
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
function mySqlTypeCast(field: any, next: any) {
|
|
29
|
-
if (field.type == 'TINY' && field.length == 1) { // Boolean
|
|
30
|
-
let value = field.string();
|
|
31
|
-
if (value == '1') return true;
|
|
32
|
-
if (value == '0') return false;
|
|
33
|
-
return null;
|
|
34
|
-
} else if (field.type == 'JSON') {
|
|
35
|
-
let value = field.string();
|
|
36
|
-
return value == null ? null : JSON.parse(value);
|
|
37
|
-
}
|
|
38
|
-
return next();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function createQueryProcessor(client: any, _options: QueryProcessorOptions = {}, engine: QueryEngine = 'pg'): QueryProcessor {
|
|
42
|
-
|
|
43
|
-
let options: QueryProcessorOptions = Object.assign({}, DEFAULT_OPTIONS, _options);
|
|
44
|
-
|
|
45
|
-
let queryOptions: ConverterOptions = {
|
|
46
|
-
lineBreak: options.lineBreaks ? '\n' : ' ',
|
|
47
|
-
nameEscape: _options.identifierQuote || (engine === 'mysql' ? '`' : '"')
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// function processSql(query: any, sql: string, params: any[] | undefined, callback: any): Promise<any> {
|
|
51
|
-
// if (options.logging) log.i(sql);
|
|
52
|
-
// if (options.logger) options.logger(sql, params);
|
|
53
|
-
|
|
54
|
-
// return new Promise((resolve, reject) => {
|
|
55
|
-
// callback(sql, params, (err: any, result: any) => {
|
|
56
|
-
// if (err) reject(err);
|
|
57
|
-
// else resolve(convertResult(query, result, engine));
|
|
58
|
-
// });
|
|
59
|
-
// });
|
|
60
|
-
// }
|
|
61
|
-
|
|
62
|
-
// function executeSql(sql: string, params: any[] | undefined, cb: any) {
|
|
63
|
-
// if (engine === 'pg') {
|
|
64
|
-
// client.query(sql, params || cb, params ? cb : undefined);
|
|
65
|
-
// } else if (engine === 'mysql') {
|
|
66
|
-
// client.query({
|
|
67
|
-
// sql,
|
|
68
|
-
// values: params,
|
|
69
|
-
// typeCast: mySqlTypeCast
|
|
70
|
-
// }, cb);
|
|
71
|
-
// } else throw new Error('Unknown DB engine: ' + engine);
|
|
72
|
-
// }
|
|
73
|
-
|
|
74
|
-
return (query: any) => {
|
|
75
|
-
if (options.parameterized) {
|
|
76
|
-
let { sql, params } = convertQueryToParameterizedSQL(query, queryOptions, engine);
|
|
77
|
-
// if (Helpers.isWebSQL || Helpers.isNode) {
|
|
78
|
-
return client.query(sql, params);
|
|
79
|
-
// }
|
|
80
|
-
// return processSql(query, sql, params, (sql: string, params: any[], cb: any) => executeSql(sql, params, cb));
|
|
81
|
-
} else {
|
|
82
|
-
let sql = convertQueryToSQL(query, queryOptions, engine);
|
|
83
|
-
// if (Helpers.isWebSQL || Helpers.isNode) {
|
|
84
|
-
return client.query(sql, undefined);
|
|
85
|
-
// }
|
|
86
|
-
// return processSql(query, sql, undefined, (sql: string, params: undefined, cb: any) => executeSql(sql, undefined, cb));
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {createQueryConverter} from "./query-converter";
|
|
2
|
-
import {convertEscapedParam} from './param-converter';
|
|
3
|
-
import {QueryEngine, ConverterOptions} from "./types";
|
|
4
|
-
|
|
5
|
-
let pgParamConverter = (index: number) => '$' + index;
|
|
6
|
-
let mySqlParamConverter = (index: number) => '?';
|
|
7
|
-
|
|
8
|
-
function convertSingleParam(param: any, params: any[], paramConverter: (param: any) => string): string {
|
|
9
|
-
params.push(convertEscapedParam(param));
|
|
10
|
-
return paramConverter(params.length);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function convertQueryToParameterizedSQL(query: any, options: ConverterOptions, engine: QueryEngine) {
|
|
14
|
-
let params: any[] = [];
|
|
15
|
-
|
|
16
|
-
let paramConverter = engine === 'mysql' ? mySqlParamConverter : pgParamConverter;
|
|
17
|
-
let sql = createQueryConverter((param: any) => convertSingleParam(param, params, paramConverter), options, engine)(query);
|
|
18
|
-
|
|
19
|
-
return { sql, params };
|
|
20
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { QueryEngine } from "./types";
|
|
2
|
-
|
|
3
|
-
export function convertResult(query: any, result: any, engine: QueryEngine): any {
|
|
4
|
-
let rows = engine === 'pg' ? result.rows : result;
|
|
5
|
-
let rowCount = engine === 'pg' ? result.rowCount : result.affectedRows || result.changedRows;
|
|
6
|
-
|
|
7
|
-
if (query._action === 'select') return convertSelectResult(query, rows);
|
|
8
|
-
if (query._action === 'delete') return rowCount;
|
|
9
|
-
if (query._action === 'update') return rowCount;
|
|
10
|
-
if (query._action === 'insert') return convertInsertResult(result, engine);
|
|
11
|
-
throw new Error('Unknown query type:' + query._action);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function convertInsertResult(result: any, engine: QueryEngine): any {
|
|
15
|
-
if (engine === 'mysql') return result.insertId > 0 ? result.insertId : undefined; // mysql returns 0 for tables that have a non-autoincrement ID
|
|
16
|
-
if (engine === 'pg' && result.rows && result.rows.length === 1) {
|
|
17
|
-
let columnName = Object.keys(result.rows[0])[0];
|
|
18
|
-
return result.rows[0][columnName];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function convertSelectResult(query: any, rows: any[]): any {
|
|
23
|
-
if (query._columns && query._columns.length === 1 &&
|
|
24
|
-
!(query._columns[0]._name === '*' && query._columns[0]._modifiers.length === 0)) {
|
|
25
|
-
if (rows.length == 0) return [];
|
|
26
|
-
let columnName = Object.keys(rows[0])[0]; // easier than reverse engineering from the column modifiers
|
|
27
|
-
let values = rows.map((row: any) => row[columnName]);
|
|
28
|
-
|
|
29
|
-
if (query._columns[0]._name === '*' && query._columns[0]._modifiers.some((m: any) => m.name === 'count')) {
|
|
30
|
-
return values.map((value: any) => Number(value)); // string to number conversion for PG count values
|
|
31
|
-
}
|
|
32
|
-
return values;
|
|
33
|
-
} else {
|
|
34
|
-
convertAliasFields(query, rows);
|
|
35
|
-
return rows;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function convertAliasFields(query: any, rows: any[]): void {
|
|
40
|
-
let aliasByName = getColumnAliasesByName(query);
|
|
41
|
-
if (Object.keys(aliasByName).length === 0) return;
|
|
42
|
-
|
|
43
|
-
rows.forEach((row: any) => {
|
|
44
|
-
Object.keys(row).forEach((name: string) => {
|
|
45
|
-
if (aliasByName[name]) {
|
|
46
|
-
row[aliasByName[name]] = row[name];
|
|
47
|
-
delete row[name];
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function getColumnAliasesByName(query: any): any {
|
|
54
|
-
let aliasByName = {} as any;
|
|
55
|
-
|
|
56
|
-
if (query._columns && query._columns.length > 0) {
|
|
57
|
-
query._columns.forEach((column: any) => {
|
|
58
|
-
if (column._name && column._name.alias && column._modifiers.length === 0) {
|
|
59
|
-
aliasByName[column._name.name] = column._name.alias;
|
|
60
|
-
} else if (column._name === '*' && column._modifiers.length === 0) {
|
|
61
|
-
getAliasColumnsOfTable(column._table).forEach((column: any) => {
|
|
62
|
-
aliasByName[column._name.name] = column._name.alias;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
} else {
|
|
67
|
-
let tables = query._table ? [query._table] : query._tables;
|
|
68
|
-
tables.forEach((table: any) => {
|
|
69
|
-
getAliasColumnsOfTable(table).forEach((column: any) => {
|
|
70
|
-
aliasByName[column._name.name] = column._name.alias;
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
let joinTable = table._parent;
|
|
74
|
-
while (joinTable) {
|
|
75
|
-
getAliasColumnsOfTable(joinTable).forEach((column: any) => {
|
|
76
|
-
aliasByName[column._name.name] = column._name.alias;
|
|
77
|
-
});
|
|
78
|
-
joinTable = joinTable._parent;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return aliasByName;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function getAliasColumnsOfTable(table: any): any[] {
|
|
87
|
-
return Object.keys(table).map(key => table[key]).filter((column: any) => column && column._name && column._name.alias);
|
|
88
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import {createQueryConverter} from "./query-converter";
|
|
2
|
-
import {convertSubstitutionParam} from './param-converter';
|
|
3
|
-
import {QueryEngine, ConverterOptions} from "./types";
|
|
4
|
-
|
|
5
|
-
export function convertQueryToSQL(query: any, options: ConverterOptions, engine: QueryEngine): string {
|
|
6
|
-
return createQueryConverter((param: any) => convertSubstitutionParam(param), options, engine)(query);
|
|
7
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export function number(param: any): number {
|
|
2
|
-
let result = Number(param);
|
|
3
|
-
if (Number.isNaN(result)) throw new Error('Invalid number parameter in SQL query: ' + param);
|
|
4
|
-
return result;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function boolean(param: any): boolean {
|
|
8
|
-
if (typeof param === 'boolean') return param;
|
|
9
|
-
if (param instanceof Boolean) return param.valueOf();
|
|
10
|
-
if (param === 'true') return true;
|
|
11
|
-
if (param === 'false') return false;
|
|
12
|
-
throw new Error('Invalid boolean parameter in SQL query: ' + param);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function date(param: any): Date {
|
|
16
|
-
if (param instanceof Date) return param; // @ts-ignore
|
|
17
|
-
if (typeof param === 'number' || param instanceof Number) return new Date(param);
|
|
18
|
-
if (typeof param === 'string' || param instanceof String) {
|
|
19
|
-
if (Number.isNaN(Date.parse(String(param)))) throw new Error('Invalid date parameter in SQL query: ' + param); // @ts-ignore
|
|
20
|
-
return new Date(param);
|
|
21
|
-
}
|
|
22
|
-
throw new Error('Invalid date parameter in SQL query: ' + param);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function string(param: any): string {
|
|
26
|
-
if (typeof param === 'string') return param;
|
|
27
|
-
if (param instanceof String) return param.valueOf();
|
|
28
|
-
throw new Error('Invalid string parameter in SQL query: ' + param);
|
|
29
|
-
}
|
package/lib-prod/lib-info.md
DELETED
|
File without changes
|