taon-type-sql 21.0.20 → 21.0.22
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/browser-prod.re-export.json +1 -0
- 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 +27 -0
- package/lib-prod/builder/column/basic-column.ts +17 -0
- package/lib-prod/builder/column/boolean-column.ts +19 -0
- package/lib-prod/builder/column/comparable-column.ts +56 -0
- package/lib-prod/builder/column/date-column.ts +19 -0
- package/lib-prod/builder/column/number-column.ts +25 -0
- package/lib-prod/builder/column/query-column.ts +34 -0
- package/lib-prod/builder/column/string-column.ts +47 -0
- package/lib-prod/builder/column/value-column.ts +39 -0
- package/lib-prod/builder/condition/{query-column-condition.d.ts → query-column-condition.ts} +20 -5
- package/lib-prod/builder/condition/query-condition-chain.ts +42 -0
- package/lib-prod/builder/condition/{query-condition.d.ts → query-condition.ts} +8 -2
- package/lib-prod/builder/condition/{query-join-condition.d.ts → query-join-condition.ts} +19 -4
- package/lib-prod/builder/helpers/generics-helper.ts +2 -0
- package/lib-prod/builder/helpers/{internal-types.d.ts → internal-types.ts} +25 -9
- package/lib-prod/builder/join/joined-tables-chain.ts +17 -0
- package/lib-prod/builder/join/joined-tables.ts +28 -0
- package/lib-prod/builder/other/{query-ordering.d.ts → query-ordering.ts} +20 -4
- package/lib-prod/builder/query/select-query.ts +68 -0
- package/lib-prod/builder/query/table-condition-query.ts +35 -0
- package/lib-prod/builder/query/table-query.ts +72 -0
- package/lib-prod/builder/{query-source.d.ts → query-source.ts} +19 -8
- package/lib-prod/builder/query-table.ts +34 -0
- package/lib-prod/client/mysql.ts +9 -0
- package/lib-prod/client/pg.ts +9 -0
- package/lib-prod/client/query-processor.ts +89 -0
- package/lib-prod/converter/{param-converter.js → param-converter.ts} +8 -16
- package/lib-prod/converter/parameterized-converter.ts +20 -0
- package/lib-prod/converter/{query-converter.js → query-converter.ts} +113 -101
- package/lib-prod/converter/result-converter.ts +88 -0
- package/lib-prod/converter/sql-converter.ts +7 -0
- package/lib-prod/converter/type-converter.ts +29 -0
- package/lib-prod/converter/{types.d.ts → types.ts} +4 -3
- package/lib-prod/env/env.angular-node-app.ts +66 -0
- package/lib-prod/env/env.docs-webapp.ts +66 -0
- package/lib-prod/env/env.electron-app.ts +66 -0
- package/lib-prod/env/env.mobile-app.ts +66 -0
- package/lib-prod/env/env.npm-lib-and-cli-tool.ts +66 -0
- package/lib-prod/env/env.vscode-plugin.ts +66 -0
- package/lib-prod/{index._auto-generated_.js → index._auto-generated_.ts} +0 -1
- package/lib-prod/{index.d.ts → index.ts} +15 -3
- package/lib-prod/lib-info.md +8 -0
- package/lib-prod/migrations/index.ts +2 -0
- package/lib-prod/migrations/migrations-info.md +6 -0
- package/lib-prod/migrations/{migrations_index._auto-generated_.js → migrations_index._auto-generated_.ts} +2 -1
- package/lib-prod/package.json +1 -1
- package/lib-prod.re-export.json +1 -0
- package/package.json +1 -1
- package/websql/package.json +1 -1
- package/websql-prod/package.json +1 -1
- package/websql-prod.re-export.json +1 -0
- package/lib-prod/build-info._auto-generated_.d.ts +0 -24
- package/lib-prod/build-info._auto-generated_.js +0 -30
- package/lib-prod/build-info._auto-generated_.js.map +0 -1
- package/lib-prod/builder/column/basic-column.d.ts +0 -8
- package/lib-prod/builder/column/basic-column.js +0 -15
- package/lib-prod/builder/column/basic-column.js.map +0 -1
- package/lib-prod/builder/column/boolean-column.d.ts +0 -9
- package/lib-prod/builder/column/boolean-column.js +0 -15
- package/lib-prod/builder/column/boolean-column.js.map +0 -1
- package/lib-prod/builder/column/comparable-column.d.ts +0 -18
- package/lib-prod/builder/column/comparable-column.js +0 -42
- package/lib-prod/builder/column/comparable-column.js.map +0 -1
- package/lib-prod/builder/column/date-column.d.ts +0 -9
- package/lib-prod/builder/column/date-column.js +0 -15
- package/lib-prod/builder/column/date-column.js.map +0 -1
- package/lib-prod/builder/column/number-column.d.ts +0 -10
- package/lib-prod/builder/column/number-column.js +0 -20
- package/lib-prod/builder/column/number-column.js.map +0 -1
- package/lib-prod/builder/column/query-column.d.ts +0 -18
- package/lib-prod/builder/column/query-column.js +0 -26
- package/lib-prod/builder/column/query-column.js.map +0 -1
- package/lib-prod/builder/column/string-column.d.ts +0 -17
- package/lib-prod/builder/column/string-column.js +0 -37
- package/lib-prod/builder/column/string-column.js.map +0 -1
- package/lib-prod/builder/column/value-column.d.ts +0 -15
- package/lib-prod/builder/column/value-column.js +0 -30
- package/lib-prod/builder/column/value-column.js.map +0 -1
- package/lib-prod/builder/condition/query-column-condition.js +0 -23
- package/lib-prod/builder/condition/query-column-condition.js.map +0 -1
- package/lib-prod/builder/condition/query-condition-chain.d.ts +0 -17
- package/lib-prod/builder/condition/query-condition-chain.js +0 -34
- package/lib-prod/builder/condition/query-condition-chain.js.map +0 -1
- package/lib-prod/builder/condition/query-condition.js +0 -7
- package/lib-prod/builder/condition/query-condition.js.map +0 -1
- package/lib-prod/builder/condition/query-join-condition.js +0 -23
- package/lib-prod/builder/condition/query-join-condition.js.map +0 -1
- package/lib-prod/builder/helpers/generics-helper.d.ts +0 -2
- package/lib-prod/builder/helpers/generics-helper.js +0 -7
- package/lib-prod/builder/helpers/generics-helper.js.map +0 -1
- package/lib-prod/builder/helpers/internal-types.js +0 -4
- package/lib-prod/builder/helpers/internal-types.js.map +0 -1
- package/lib-prod/builder/join/joined-tables-chain.d.ts +0 -11
- package/lib-prod/builder/join/joined-tables-chain.js +0 -18
- package/lib-prod/builder/join/joined-tables-chain.js.map +0 -1
- package/lib-prod/builder/join/joined-tables.d.ts +0 -12
- package/lib-prod/builder/join/joined-tables.js +0 -25
- package/lib-prod/builder/join/joined-tables.js.map +0 -1
- package/lib-prod/builder/other/query-ordering.js +0 -21
- package/lib-prod/builder/other/query-ordering.js.map +0 -1
- package/lib-prod/builder/query/select-query.d.ts +0 -29
- package/lib-prod/builder/query/select-query.js +0 -54
- package/lib-prod/builder/query/select-query.js.map +0 -1
- package/lib-prod/builder/query/table-condition-query.d.ts +0 -16
- package/lib-prod/builder/query/table-condition-query.js +0 -31
- package/lib-prod/builder/query/table-condition-query.js.map +0 -1
- package/lib-prod/builder/query/table-query.d.ts +0 -23
- package/lib-prod/builder/query/table-query.js +0 -60
- package/lib-prod/builder/query/table-query.js.map +0 -1
- package/lib-prod/builder/query-source.js +0 -22
- package/lib-prod/builder/query-source.js.map +0 -1
- package/lib-prod/builder/query-table.d.ts +0 -15
- package/lib-prod/builder/query-table.js +0 -28
- package/lib-prod/builder/query-table.js.map +0 -1
- package/lib-prod/client/mysql.d.ts +0 -5
- package/lib-prod/client/mysql.js +0 -11
- package/lib-prod/client/mysql.js.map +0 -1
- package/lib-prod/client/pg.d.ts +0 -5
- package/lib-prod/client/pg.js +0 -11
- package/lib-prod/client/pg.js.map +0 -1
- package/lib-prod/client/query-processor.d.ts +0 -10
- package/lib-prod/client/query-processor.js +0 -73
- package/lib-prod/client/query-processor.js.map +0 -1
- package/lib-prod/converter/param-converter.d.ts +0 -2
- package/lib-prod/converter/param-converter.js.map +0 -1
- package/lib-prod/converter/parameterized-converter.d.ts +0 -5
- package/lib-prod/converter/parameterized-converter.js +0 -18
- package/lib-prod/converter/parameterized-converter.js.map +0 -1
- package/lib-prod/converter/query-converter.d.ts +0 -2
- package/lib-prod/converter/query-converter.js.map +0 -1
- package/lib-prod/converter/result-converter.d.ts +0 -2
- package/lib-prod/converter/result-converter.js +0 -89
- package/lib-prod/converter/result-converter.js.map +0 -1
- package/lib-prod/converter/sql-converter.d.ts +0 -2
- package/lib-prod/converter/sql-converter.js +0 -9
- package/lib-prod/converter/sql-converter.js.map +0 -1
- package/lib-prod/converter/type-converter.d.ts +0 -4
- package/lib-prod/converter/type-converter.js +0 -43
- package/lib-prod/converter/type-converter.js.map +0 -1
- package/lib-prod/converter/types.js +0 -3
- package/lib-prod/converter/types.js.map +0 -1
- package/lib-prod/env/env.angular-node-app.d.ts +0 -64
- package/lib-prod/env/env.angular-node-app.js +0 -71
- package/lib-prod/env/env.angular-node-app.js.map +0 -1
- package/lib-prod/env/env.docs-webapp.d.ts +0 -64
- package/lib-prod/env/env.docs-webapp.js +0 -71
- package/lib-prod/env/env.docs-webapp.js.map +0 -1
- package/lib-prod/env/env.electron-app.d.ts +0 -64
- package/lib-prod/env/env.electron-app.js +0 -71
- package/lib-prod/env/env.electron-app.js.map +0 -1
- package/lib-prod/env/env.mobile-app.d.ts +0 -64
- package/lib-prod/env/env.mobile-app.js +0 -71
- package/lib-prod/env/env.mobile-app.js.map +0 -1
- package/lib-prod/env/env.npm-lib-and-cli-tool.d.ts +0 -64
- package/lib-prod/env/env.npm-lib-and-cli-tool.js +0 -71
- package/lib-prod/env/env.npm-lib-and-cli-tool.js.map +0 -1
- package/lib-prod/env/env.vscode-plugin.d.ts +0 -64
- package/lib-prod/env/env.vscode-plugin.js +0 -71
- package/lib-prod/env/env.vscode-plugin.js.map +0 -1
- package/lib-prod/env/index.js +0 -23
- package/lib-prod/env/index.js.map +0 -1
- package/lib-prod/index._auto-generated_.d.ts +0 -0
- package/lib-prod/index._auto-generated_.js.map +0 -1
- package/lib-prod/index.js +0 -48
- package/lib-prod/index.js.map +0 -1
- package/lib-prod/migrations/index.d.ts +0 -1
- package/lib-prod/migrations/index.js +0 -19
- package/lib-prod/migrations/index.js.map +0 -1
- package/lib-prod/migrations/migrations_index._auto-generated_.d.ts +0 -0
- package/lib-prod/migrations/migrations_index._auto-generated_.js.map +0 -1
- /package/lib-prod/env/{index.d.ts → index.ts} +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const comparable_column_1 = require("./comparable-column");
|
|
4
|
-
class NumberColumn extends comparable_column_1.default {
|
|
5
|
-
_type = 'number';
|
|
6
|
-
constructor(table, name, modifiers = []) {
|
|
7
|
-
super(table, name, modifiers);
|
|
8
|
-
}
|
|
9
|
-
count() {
|
|
10
|
-
return new NumberColumn(this._table, this._name, this._modifiers.concat({ name: 'count' }));
|
|
11
|
-
}
|
|
12
|
-
sum() {
|
|
13
|
-
return new NumberColumn(this._table, this._name, this._modifiers.concat({ name: 'sum' }));
|
|
14
|
-
}
|
|
15
|
-
avg() {
|
|
16
|
-
return new NumberColumn(this._table, this._name, this._modifiers.concat({ name: 'avg' }));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.default = NumberColumn;
|
|
20
|
-
//# sourceMappingURL=number-column.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number-column.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AACA,2DAAmD;AAInD,MAAqB,YAAiD,SAAQ,2BAA+B;IAE/F,KAAK,GAAG,QAAQ,CAAC;IAE3B,YAAY,KAAY,EAAE,IAAgB,EAAE,YAA8B,EAAE;QACxE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAClC,CAAC;IAED,KAAK;QACD,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAChG,CAAC;IAED,GAAG;QACC,OAAO,IAAI,YAAY,CAAQ,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,GAAG;QACC,OAAO,IAAI,YAAY,CAAQ,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACrG,CAAC;CACJ;AAnBD,+BAmBC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import QueryTable from "../query-table";
|
|
2
|
-
import NumberColumn from "./number-column";
|
|
3
|
-
import GenericsHelper from "../helpers/generics-helper";
|
|
4
|
-
import QueryColumnCondition from "../condition/query-column-condition";
|
|
5
|
-
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
6
|
-
declare abstract class QueryColumn<Table extends QueryTable<any, any>, T> {
|
|
7
|
-
protected _table: Table;
|
|
8
|
-
protected _name: ColumnName;
|
|
9
|
-
protected _modifiers: ColumnModifier[];
|
|
10
|
-
protected _$type: GenericsHelper<T>;
|
|
11
|
-
protected _type: string;
|
|
12
|
-
constructor(_table: Table, _name: ColumnName, _modifiers?: ColumnModifier[]);
|
|
13
|
-
abstract count(): NumberColumn<Table>;
|
|
14
|
-
as(alias: string): this;
|
|
15
|
-
isNull(): QueryColumnCondition<Table, T>;
|
|
16
|
-
isNotNull(): QueryColumnCondition<Table, T>;
|
|
17
|
-
}
|
|
18
|
-
export default QueryColumn;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const query_column_condition_1 = require("../condition/query-column-condition");
|
|
4
|
-
class QueryColumn {
|
|
5
|
-
_table;
|
|
6
|
-
_name;
|
|
7
|
-
_modifiers;
|
|
8
|
-
_$type;
|
|
9
|
-
_type;
|
|
10
|
-
constructor(_table, _name, _modifiers = []) {
|
|
11
|
-
this._table = _table;
|
|
12
|
-
this._name = _name;
|
|
13
|
-
this._modifiers = _modifiers;
|
|
14
|
-
}
|
|
15
|
-
as(alias) {
|
|
16
|
-
return new this.constructor(this._table, this._name, this._modifiers.concat({ name: 'as', params: alias }));
|
|
17
|
-
}
|
|
18
|
-
isNull() {
|
|
19
|
-
return new query_column_condition_1.default(this, 'is-null');
|
|
20
|
-
}
|
|
21
|
-
isNotNull() {
|
|
22
|
-
return new query_column_condition_1.default(this, 'is-not-null');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.default = QueryColumn;
|
|
26
|
-
//# sourceMappingURL=query-column.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-column.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAGA,gFAAuE;AAIvE,MAAe,WAAW;IAMR;IACA;IACA;IANJ,MAAM,CAAoB;IAC1B,KAAK,CAAS;IAExB,YACc,MAAa,EACb,KAAiB,EACjB,aAA+B,EAAE;QAFjC,WAAM,GAAN,MAAM,CAAO;QACb,UAAK,GAAL,KAAK,CAAY;QACjB,eAAU,GAAV,UAAU,CAAuB;IAC5C,CAAC;IAIJ,EAAE,CAAC,KAAa;QACZ,OAAO,IAAU,IAAI,CAAC,WAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACvH,CAAC;IAED,MAAM;QACF,OAAO,IAAI,gCAAoB,CAAW,IAAI,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED,SAAS;QACL,OAAO,IAAI,gCAAoB,CAAW,IAAI,EAAE,aAAa,CAAC,CAAC;IACnE,CAAC;CACJ;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import QueryTable from "../query-table";
|
|
2
|
-
import ComparableColumn from "./comparable-column";
|
|
3
|
-
import NumberColumn from "./number-column";
|
|
4
|
-
import QueryColumnCondition from "../condition/query-column-condition";
|
|
5
|
-
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
6
|
-
export default class StringColumn<Table extends QueryTable<any, any>> extends ComparableColumn<Table, string> {
|
|
7
|
-
protected _type: string;
|
|
8
|
-
constructor(table: Table, name: ColumnName, modifiers?: ColumnModifier[]);
|
|
9
|
-
count(): NumberColumn<Table>;
|
|
10
|
-
lower(): this;
|
|
11
|
-
upper(): this;
|
|
12
|
-
contains(value: string): QueryColumnCondition<Table, string>;
|
|
13
|
-
startsWith(value: string): QueryColumnCondition<Table, string>;
|
|
14
|
-
endsWith(value: string): QueryColumnCondition<Table, string>;
|
|
15
|
-
like(value: string): QueryColumnCondition<Table, string>;
|
|
16
|
-
notLike(value: string): QueryColumnCondition<Table, string>;
|
|
17
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const comparable_column_1 = require("./comparable-column");
|
|
4
|
-
const number_column_1 = require("./number-column");
|
|
5
|
-
const query_column_condition_1 = require("../condition/query-column-condition");
|
|
6
|
-
class StringColumn extends comparable_column_1.default {
|
|
7
|
-
_type = 'string';
|
|
8
|
-
constructor(table, name, modifiers = []) {
|
|
9
|
-
super(table, name, modifiers);
|
|
10
|
-
}
|
|
11
|
-
count() {
|
|
12
|
-
return new number_column_1.default(this._table, this._name, this._modifiers.concat({ name: 'count' }));
|
|
13
|
-
}
|
|
14
|
-
lower() {
|
|
15
|
-
return new this.constructor(this._table, this._name, this._modifiers.concat({ name: 'lower' }));
|
|
16
|
-
}
|
|
17
|
-
upper() {
|
|
18
|
-
return new this.constructor(this._table, this._name, this._modifiers.concat({ name: 'upper' }));
|
|
19
|
-
}
|
|
20
|
-
contains(value) {
|
|
21
|
-
return this.like('%' + value + '%');
|
|
22
|
-
}
|
|
23
|
-
startsWith(value) {
|
|
24
|
-
return this.like(value + '%');
|
|
25
|
-
}
|
|
26
|
-
endsWith(value) {
|
|
27
|
-
return this.like('%' + value);
|
|
28
|
-
}
|
|
29
|
-
like(value) {
|
|
30
|
-
return new query_column_condition_1.default(this, 'like', value);
|
|
31
|
-
}
|
|
32
|
-
notLike(value) {
|
|
33
|
-
return new query_column_condition_1.default(this, 'not-like', value);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.default = StringColumn;
|
|
37
|
-
//# sourceMappingURL=string-column.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string-column.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AACA,2DAAmD;AACnD,mDAA2C;AAC3C,gFAAuE;AAIvE,MAAqB,YAAiD,SAAQ,2BAA+B;IAE/F,KAAK,GAAG,QAAQ,CAAC;IAE3B,YAAY,KAAY,EAAE,IAAgB,EAAE,YAA8B,EAAE;QACxE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAClC,CAAC;IAED,KAAK;QACD,OAAO,IAAI,uBAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAChG,CAAC;IAED,KAAK;QACD,OAAO,IAAU,IAAI,CAAC,WAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC3G,CAAC;IAED,KAAK;QACD,OAAO,IAAU,IAAI,CAAC,WAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC3G,CAAC;IAED,QAAQ,CAAC,KAAa;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC;IACxC,CAAC;IAED,UAAU,CAAC,KAAa;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,QAAQ,CAAC,KAAa;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,KAAa;QACd,OAAO,IAAI,gCAAoB,CAAgB,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,CAAC,KAAa;QACjB,OAAO,IAAI,gCAAoB,CAAgB,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;CACJ;AAvCD,+BAuCC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import QueryColumnCondition from "../condition/query-column-condition";
|
|
2
|
-
import QueryOrdering from "../other/query-ordering";
|
|
3
|
-
import QueryTable from "../query-table";
|
|
4
|
-
import QueryColumn from "./query-column";
|
|
5
|
-
import QueryJoinCondition from "../condition/query-join-condition";
|
|
6
|
-
import { ColumnModifier, ColumnName } from "../helpers/internal-types";
|
|
7
|
-
declare abstract class ValueColumn<Table extends QueryTable<any, any>, T> extends QueryColumn<Table, T> {
|
|
8
|
-
constructor(table: Table, name: ColumnName, modifiers?: ColumnModifier[]);
|
|
9
|
-
asc(): QueryOrdering<Table>;
|
|
10
|
-
desc(): QueryOrdering<Table>;
|
|
11
|
-
eq<Table2 extends QueryTable<any, any>>(value: QueryColumn<Table2, T>): QueryJoinCondition<Table, Table2, T>;
|
|
12
|
-
eq(value: T): QueryColumnCondition<Table, T>;
|
|
13
|
-
ne(value: T): QueryColumnCondition<Table, T>;
|
|
14
|
-
}
|
|
15
|
-
export default ValueColumn;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const query_column_condition_1 = require("../condition/query-column-condition");
|
|
4
|
-
const query_ordering_1 = require("../other/query-ordering");
|
|
5
|
-
const query_column_1 = require("./query-column");
|
|
6
|
-
const query_join_condition_1 = require("../condition/query-join-condition");
|
|
7
|
-
class ValueColumn extends query_column_1.default {
|
|
8
|
-
constructor(table, name, modifiers = []) {
|
|
9
|
-
super(table, name, modifiers);
|
|
10
|
-
}
|
|
11
|
-
asc() {
|
|
12
|
-
return new query_ordering_1.default(this, 'ASC');
|
|
13
|
-
}
|
|
14
|
-
desc() {
|
|
15
|
-
return new query_ordering_1.default(this, 'DESC');
|
|
16
|
-
}
|
|
17
|
-
eq(value) {
|
|
18
|
-
if (value instanceof query_column_1.default) {
|
|
19
|
-
return new query_join_condition_1.default(this, 'eq', value);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return new query_column_condition_1.default(this, 'eq', value);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
ne(value) {
|
|
26
|
-
return new query_column_condition_1.default(this, 'ne', value);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = ValueColumn;
|
|
30
|
-
//# sourceMappingURL=value-column.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"value-column.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAAA,gFAAuE;AACvE,4DAAoD;AAEpD,iDAAyC;AAEzC,4EAAmE;AAInE,MAAe,WAAmD,SAAQ,sBAAqB;IAE3F,YAAY,KAAY,EAAE,IAAgB,EAAE,YAA8B,EAAE;QACxE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAClC,CAAC;IAED,GAAG;QACC,OAAO,IAAI,wBAAa,CAAQ,IAAI,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAED,IAAI;QACA,OAAO,IAAI,wBAAa,CAAQ,IAAI,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IAID,EAAE,CAAsC,KAAU;QAC9C,IAAI,KAAK,YAAY,sBAAW,EAAE,CAAC;YAC/B,OAAO,IAAI,8BAAkB,CAAmB,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACvE,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,gCAAoB,CAAW,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACjE,CAAC;IACL,CAAC;IAED,EAAE,CAAC,KAAQ;QACP,OAAO,IAAI,gCAAoB,CAAW,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;CACJ;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const query_condition_1 = require("./query-condition");
|
|
4
|
-
const query_condition_chain_1 = require("./query-condition-chain");
|
|
5
|
-
class QueryColumnCondition extends query_condition_1.default {
|
|
6
|
-
_column;
|
|
7
|
-
_type;
|
|
8
|
-
_values;
|
|
9
|
-
constructor(column, type, ...values) {
|
|
10
|
-
super();
|
|
11
|
-
this._column = column;
|
|
12
|
-
this._type = type;
|
|
13
|
-
this._values = values;
|
|
14
|
-
}
|
|
15
|
-
and(condition) {
|
|
16
|
-
return new query_condition_chain_1.default(this, condition, 'and');
|
|
17
|
-
}
|
|
18
|
-
or(condition) {
|
|
19
|
-
return new query_condition_chain_1.default(this, condition, 'or');
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.default = QueryColumnCondition;
|
|
23
|
-
//# sourceMappingURL=query-column-condition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-column-condition.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAEA,uDAA+C;AAC/C,mEAA0D;AAI1D,MAAqB,oBAA4D,SAAQ,yBAAqB;IAEhG,OAAO,CAAwB;IAC/B,KAAK,CAAgB;IACrB,OAAO,CAAM;IAEvB,YAAY,MAA6B,EAAE,IAAmB,EAAE,GAAG,MAAW;QAC1E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,GAAG,CAAsC,SAAiC;QACtE,OAAO,IAAI,+BAAmB,CAAiB,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;IAED,EAAE,CAAsC,SAAiC;QACrE,OAAO,IAAI,+BAAmB,CAAiB,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;CACJ;AApBD,uCAoBC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import QueryTable from "../query-table";
|
|
2
|
-
import QueryCondition from "./query-condition";
|
|
3
|
-
import GenericsHelper from "../helpers/generics-helper";
|
|
4
|
-
import { ConditionChainType } from "../helpers/internal-types";
|
|
5
|
-
export default class QueryConditionChain<Table extends QueryTable<any, any>> extends QueryCondition<Table> {
|
|
6
|
-
protected _$type: GenericsHelper<Table>;
|
|
7
|
-
protected _sibling: QueryCondition<any>;
|
|
8
|
-
protected _child: QueryCondition<any>;
|
|
9
|
-
protected _chainType: ConditionChainType;
|
|
10
|
-
protected _parenthesis: boolean;
|
|
11
|
-
protected _negation: boolean;
|
|
12
|
-
constructor(sibling: QueryCondition<any>, child: QueryCondition<any>, chainType: ConditionChainType);
|
|
13
|
-
$(): this;
|
|
14
|
-
not(): this;
|
|
15
|
-
and<Table2 extends QueryTable<any, any>>(condition: QueryCondition<Table2>): QueryConditionChain<Table | Table2>;
|
|
16
|
-
or<Table2 extends QueryTable<any, any>>(condition: QueryCondition<Table2>): QueryConditionChain<Table | Table2>;
|
|
17
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const query_condition_1 = require("./query-condition");
|
|
4
|
-
class QueryConditionChain extends query_condition_1.default {
|
|
5
|
-
_$type;
|
|
6
|
-
_sibling;
|
|
7
|
-
_child;
|
|
8
|
-
_chainType;
|
|
9
|
-
_parenthesis = false;
|
|
10
|
-
_negation = false;
|
|
11
|
-
constructor(sibling, child, chainType) {
|
|
12
|
-
super();
|
|
13
|
-
this._sibling = sibling;
|
|
14
|
-
this._child = child;
|
|
15
|
-
this._chainType = chainType;
|
|
16
|
-
}
|
|
17
|
-
// TODO how to call this
|
|
18
|
-
$() {
|
|
19
|
-
this._parenthesis = true;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
not() {
|
|
23
|
-
this._negation = true;
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
and(condition) {
|
|
27
|
-
return new QueryConditionChain(this, condition, 'and');
|
|
28
|
-
}
|
|
29
|
-
or(condition) {
|
|
30
|
-
return new QueryConditionChain(this, condition, 'or');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.default = QueryConditionChain;
|
|
34
|
-
//# sourceMappingURL=query-condition-chain.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-condition-chain.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AACA,uDAA+C;AAK/C,MAAqB,mBAAwD,SAAQ,yBAAqB;IAE5F,MAAM,CAAwB;IAE9B,QAAQ,CAAsB;IAC9B,MAAM,CAAsB;IAC5B,UAAU,CAAqB;IAC/B,YAAY,GAAG,KAAK,CAAC;IACrB,SAAS,GAAG,KAAK,CAAC;IAE5B,YAAY,OAA4B,EAAE,KAA0B,EAAE,SAA6B;QAC/F,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAChC,CAAC;IAED,wBAAwB;IACxB,CAAC;QACG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,GAAG;QACC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,GAAG,CAAsC,SAAiC;QACtE,OAAO,IAAI,mBAAmB,CAAiB,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;IAED,EAAE,CAAsC,SAAiC;QACrE,OAAO,IAAI,mBAAmB,CAAiB,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;CACJ;AAnCD,sCAmCC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// TODO I had to copy-paste the method implementations to every child class to avoid circular dependencies
|
|
4
|
-
class QueryCondition {
|
|
5
|
-
}
|
|
6
|
-
exports.default = QueryCondition;
|
|
7
|
-
//# sourceMappingURL=query-condition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-condition.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAGA,0GAA0G;AAE1G,MAAe,cAAc;CAK5B;AAED,kBAAe,cAAc,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const query_condition_1 = require("./query-condition");
|
|
4
|
-
const query_condition_chain_1 = require("./query-condition-chain");
|
|
5
|
-
class QueryJoinCondition extends query_condition_1.default {
|
|
6
|
-
_column;
|
|
7
|
-
_type;
|
|
8
|
-
_otherColumn;
|
|
9
|
-
constructor(column, type, otherColumn) {
|
|
10
|
-
super();
|
|
11
|
-
this._column = column;
|
|
12
|
-
this._type = type;
|
|
13
|
-
this._otherColumn = otherColumn;
|
|
14
|
-
}
|
|
15
|
-
and(condition) {
|
|
16
|
-
return new query_condition_chain_1.default(this, condition, 'and');
|
|
17
|
-
}
|
|
18
|
-
or(condition) {
|
|
19
|
-
return new query_condition_chain_1.default(this, condition, 'or');
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.default = QueryJoinCondition;
|
|
23
|
-
//# sourceMappingURL=query-join-condition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-join-condition.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAEA,uDAA+C;AAC/C,mEAA0D;AAG1D,MAAqB,kBAAgG,SAAQ,yBAA+B;IAE9I,OAAO,CAAyB;IAChC,KAAK,CAAS;IACd,YAAY,CAAyB;IAE/C,YAAY,MAA8B,EAAE,IAAY,EAAE,WAAmC;QACzF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IACpC,CAAC;IAED,GAAG,CAAsC,SAAiC;QACtE,OAAO,IAAI,+BAAmB,CAA2B,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACrF,CAAC;IAED,EAAE,CAAsC,SAAiC;QACrE,OAAO,IAAI,+BAAmB,CAA2B,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACpF,CAAC;CACJ;AApBD,qCAoBC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// TODO In TS generic parameters not used in the class are not enforced, so I have to add dummy fields that use them. Replace with nominal typing
|
|
4
|
-
class GenericsHelper {
|
|
5
|
-
}
|
|
6
|
-
exports.default = GenericsHelper;
|
|
7
|
-
//# sourceMappingURL=generics-helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generics-helper.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAAA,iJAAiJ;AACjJ,MAAqB,cAAc;CAAM;AAAzC,iCAAyC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.js","sourceRoot":"","sources":[""],"names":[],"mappings":";AAAA,SAAS"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import QueryTable from "../query-table";
|
|
2
|
-
import QueryJoinCondition from "../condition/query-join-condition";
|
|
3
|
-
import JoinedTables from "./joined-tables";
|
|
4
|
-
import { JoinType } from "../helpers/internal-types";
|
|
5
|
-
export default class JoinedTablesChain<Tables extends QueryTable<any, any>> {
|
|
6
|
-
protected _table: QueryTable<any, any>;
|
|
7
|
-
protected _modifier: JoinType;
|
|
8
|
-
protected _parent: JoinedTables<Tables> | QueryTable<any, any>;
|
|
9
|
-
constructor(_table: QueryTable<any, any>, _modifier: JoinType, _parent: JoinedTables<Tables> | QueryTable<any, any>);
|
|
10
|
-
on(condition: QueryJoinCondition<Tables, Tables, any>): JoinedTables<Tables>;
|
|
11
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const joined_tables_1 = require("./joined-tables");
|
|
4
|
-
class JoinedTablesChain {
|
|
5
|
-
_table;
|
|
6
|
-
_modifier;
|
|
7
|
-
_parent;
|
|
8
|
-
constructor(_table, _modifier, _parent) {
|
|
9
|
-
this._table = _table;
|
|
10
|
-
this._modifier = _modifier;
|
|
11
|
-
this._parent = _parent;
|
|
12
|
-
}
|
|
13
|
-
on(condition) {
|
|
14
|
-
return new joined_tables_1.default(condition, this);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.default = JoinedTablesChain;
|
|
18
|
-
//# sourceMappingURL=joined-tables-chain.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"joined-tables-chain.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAEA,mDAA2C;AAG3C,MAAqB,iBAAiB;IAGpB;IACA;IACA;IAHd,YACc,MAA4B,EAC5B,SAAmB,EACnB,OAAoD;QAFpD,WAAM,GAAN,MAAM,CAAsB;QAC5B,cAAS,GAAT,SAAS,CAAU;QACnB,YAAO,GAAP,OAAO,CAA6C;IAC/D,CAAC;IAEJ,EAAE,CAAC,SAAkD;QACjD,OAAO,IAAI,uBAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;CACJ;AAXD,oCAWC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import QueryTable from "../query-table";
|
|
2
|
-
import JoinedTablesChain from "./joined-tables-chain";
|
|
3
|
-
import QueryJoinCondition from "../condition/query-join-condition";
|
|
4
|
-
export default class JoinedTables<Tables extends QueryTable<any, any>> {
|
|
5
|
-
protected _condition: QueryJoinCondition<Tables, Tables, any>;
|
|
6
|
-
protected _parent: JoinedTablesChain<Tables>;
|
|
7
|
-
constructor(_condition: QueryJoinCondition<Tables, Tables, any>, _parent: JoinedTablesChain<Tables>);
|
|
8
|
-
innerJoin<JoinTable extends QueryTable<any, any>>(table: JoinTable): JoinedTablesChain<Tables | JoinTable>;
|
|
9
|
-
leftJoin<JoinTable extends QueryTable<any, any>>(table: JoinTable): JoinedTablesChain<Tables | JoinTable>;
|
|
10
|
-
rightJoin<JoinTable extends QueryTable<any, any>>(table: JoinTable): JoinedTablesChain<Tables | JoinTable>;
|
|
11
|
-
fullJoin<JoinTable extends QueryTable<any, any>>(table: JoinTable): JoinedTablesChain<Tables | JoinTable>;
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const joined_tables_chain_1 = require("./joined-tables-chain");
|
|
4
|
-
class JoinedTables {
|
|
5
|
-
_condition;
|
|
6
|
-
_parent;
|
|
7
|
-
constructor(_condition, _parent) {
|
|
8
|
-
this._condition = _condition;
|
|
9
|
-
this._parent = _parent;
|
|
10
|
-
}
|
|
11
|
-
innerJoin(table) {
|
|
12
|
-
return new joined_tables_chain_1.default(table, 'inner', this);
|
|
13
|
-
}
|
|
14
|
-
leftJoin(table) {
|
|
15
|
-
return new joined_tables_chain_1.default(table, 'left', this);
|
|
16
|
-
}
|
|
17
|
-
rightJoin(table) {
|
|
18
|
-
return new joined_tables_chain_1.default(table, 'right', this);
|
|
19
|
-
}
|
|
20
|
-
fullJoin(table) {
|
|
21
|
-
return new joined_tables_chain_1.default(table, 'full', this);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.default = JoinedTables;
|
|
25
|
-
//# sourceMappingURL=joined-tables.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"joined-tables.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AACA,+DAAsD;AAItD,MAAqB,YAAY;IAGf;IACA;IAFd,YACc,UAAmD,EACnD,OAAkC;QADlC,eAAU,GAAV,UAAU,CAAyC;QACnD,YAAO,GAAP,OAAO,CAA2B;IAC7C,CAAC;IAEJ,SAAS,CAAyC,KAAgB;QAC9D,OAAO,IAAI,6BAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,QAAQ,CAAyC,KAAgB;QAC7D,OAAO,IAAI,6BAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,SAAS,CAAyC,KAAgB;QAC9D,OAAO,IAAI,6BAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,QAAQ,CAAyC,KAAgB;QAC7D,OAAO,IAAI,6BAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACJ;AAtBD,+BAsBC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class QueryOrdering {
|
|
4
|
-
_column;
|
|
5
|
-
_direction;
|
|
6
|
-
_nullsPosition;
|
|
7
|
-
constructor(column, direction) {
|
|
8
|
-
this._column = column;
|
|
9
|
-
this._direction = direction;
|
|
10
|
-
}
|
|
11
|
-
nullsFirst() {
|
|
12
|
-
this._nullsPosition = 'FIRST';
|
|
13
|
-
return this;
|
|
14
|
-
}
|
|
15
|
-
nullsLast() {
|
|
16
|
-
this._nullsPosition = 'LAST';
|
|
17
|
-
return this;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.default = QueryOrdering;
|
|
21
|
-
//# sourceMappingURL=query-ordering.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-ordering.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAIA,MAAqB,aAAa;IAEpB,OAAO,CAA0B;IACjC,UAAU,CAAiB;IAC3B,cAAc,CAAmB;IAE3C,YAAY,MAA+B,EAAE,SAAyB;QAClE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAChC,CAAC;IAED,UAAU;QACN,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,SAAS;QACL,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;CAEJ;AArBD,gCAqBC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import QueryCondition from "../condition/query-condition";
|
|
2
|
-
import QueryOrdering from "../other/query-ordering";
|
|
3
|
-
import QueryTable from "../query-table";
|
|
4
|
-
import QueryColumn from "../column/query-column";
|
|
5
|
-
import { QueryProcessor, QueryAction } from "../helpers/internal-types";
|
|
6
|
-
export default class SelectQuery<Entity, Table extends QueryTable<Entity, any>> {
|
|
7
|
-
protected _queryProcessor: QueryProcessor;
|
|
8
|
-
protected _tables: Table[];
|
|
9
|
-
constructor(_queryProcessor: QueryProcessor, _tables: Table[]);
|
|
10
|
-
protected _distinct: boolean;
|
|
11
|
-
protected _offset: number;
|
|
12
|
-
protected _limit: number;
|
|
13
|
-
protected _conditions: QueryCondition<Table>[];
|
|
14
|
-
protected _groupBy: QueryColumn<Table, any>[];
|
|
15
|
-
protected _having: QueryCondition<Table>[];
|
|
16
|
-
protected _orderings: (QueryColumn<Table, any> | QueryOrdering<Table>)[];
|
|
17
|
-
protected _columns: QueryColumn<Table, any>[];
|
|
18
|
-
protected _action: QueryAction;
|
|
19
|
-
offset(offset: number): this;
|
|
20
|
-
limit(limit: number): this;
|
|
21
|
-
distinct(): this;
|
|
22
|
-
where(...conditions: QueryCondition<Table>[]): this;
|
|
23
|
-
groupBy(...columns: QueryColumn<Table, any>[]): this;
|
|
24
|
-
having(...conditions: QueryCondition<Table>[]): this;
|
|
25
|
-
orderBy(...orderings: (QueryColumn<Table, any> | QueryOrdering<Table>)[]): this;
|
|
26
|
-
select(): Promise<Entity[]>;
|
|
27
|
-
select<T>(column: QueryColumn<Table, T>): Promise<T[]>;
|
|
28
|
-
select(...columns: QueryColumn<Table, any>[]): Promise<any[]>;
|
|
29
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class SelectQuery {
|
|
4
|
-
_queryProcessor;
|
|
5
|
-
_tables;
|
|
6
|
-
constructor(_queryProcessor, _tables) {
|
|
7
|
-
this._queryProcessor = _queryProcessor;
|
|
8
|
-
this._tables = _tables;
|
|
9
|
-
}
|
|
10
|
-
_distinct = false;
|
|
11
|
-
_offset;
|
|
12
|
-
_limit;
|
|
13
|
-
_conditions = [];
|
|
14
|
-
_groupBy = [];
|
|
15
|
-
_having = [];
|
|
16
|
-
_orderings = [];
|
|
17
|
-
_columns = [];
|
|
18
|
-
_action;
|
|
19
|
-
offset(offset) {
|
|
20
|
-
this._offset = offset;
|
|
21
|
-
return this;
|
|
22
|
-
}
|
|
23
|
-
limit(limit) {
|
|
24
|
-
this._limit = limit;
|
|
25
|
-
return this;
|
|
26
|
-
}
|
|
27
|
-
distinct() {
|
|
28
|
-
this._distinct = true;
|
|
29
|
-
return this;
|
|
30
|
-
}
|
|
31
|
-
where(...conditions) {
|
|
32
|
-
this._conditions = conditions;
|
|
33
|
-
return this;
|
|
34
|
-
}
|
|
35
|
-
groupBy(...columns) {
|
|
36
|
-
this._groupBy = columns;
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
having(...conditions) {
|
|
40
|
-
this._having = conditions;
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
orderBy(...orderings) {
|
|
44
|
-
this._orderings = orderings;
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
select(...columns) {
|
|
48
|
-
this._columns = columns;
|
|
49
|
-
this._action = 'select';
|
|
50
|
-
return this._queryProcessor(this);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.default = SelectQuery;
|
|
54
|
-
//# sourceMappingURL=select-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select-query.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAOA,MAAqB,WAAW;IAGd;IACA;IAFd,YACc,eAA+B,EAC/B,OAAgB;QADhB,oBAAe,GAAf,eAAe,CAAgB;QAC/B,YAAO,GAAP,OAAO,CAAS;IAC3B,CAAC;IAEM,SAAS,GAAG,KAAK,CAAC;IAClB,OAAO,CAAS;IAChB,MAAM,CAAS;IACf,WAAW,GAA4B,EAAE,CAAC;IAC1C,QAAQ,GAA8B,EAAE,CAAC;IACzC,OAAO,GAA4B,EAAE,CAAC;IACtC,UAAU,GAAuD,EAAE,CAAC;IACpE,QAAQ,GAA8B,EAAE,CAAC;IACzC,OAAO,CAAc;IAE/B,MAAM,CAAC,MAAc;QACjB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,KAAa;QACf,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,QAAQ;QACJ,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,GAAG,UAAmC;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,GAAG,OAAkC;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,GAAG,UAAmC;QACzC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,GAAG,SAA6D;QACpE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,OAAO,IAAI,CAAC;IAChB,CAAC;IAKD,MAAM,CAAC,GAAG,OAAkC;QACxC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CACJ;AA5DD,8BA4DC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import QueryTable from "../query-table";
|
|
2
|
-
import QueryCondition from "../condition/query-condition";
|
|
3
|
-
import QueryColumn from "../column/query-column";
|
|
4
|
-
import { QueryProcessor, QueryAction } from "../helpers/internal-types";
|
|
5
|
-
export default class TableConditionQuery<Entity, Table extends QueryTable<Entity, any>> {
|
|
6
|
-
protected _queryProcessor: QueryProcessor;
|
|
7
|
-
protected _table: Table;
|
|
8
|
-
protected _conditions: QueryCondition<Table>[];
|
|
9
|
-
constructor(_queryProcessor: QueryProcessor, _table: Table, _conditions: QueryCondition<Table>[]);
|
|
10
|
-
protected _columns: QueryColumn<Table, any>[];
|
|
11
|
-
protected _action: QueryAction;
|
|
12
|
-
protected _entity: Entity | Partial<Entity>;
|
|
13
|
-
update(entity: Partial<Entity>): Promise<number>;
|
|
14
|
-
delete(): Promise<number>;
|
|
15
|
-
count(): Promise<number>;
|
|
16
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class TableConditionQuery {
|
|
4
|
-
_queryProcessor;
|
|
5
|
-
_table;
|
|
6
|
-
_conditions;
|
|
7
|
-
constructor(_queryProcessor, _table, _conditions) {
|
|
8
|
-
this._queryProcessor = _queryProcessor;
|
|
9
|
-
this._table = _table;
|
|
10
|
-
this._conditions = _conditions;
|
|
11
|
-
}
|
|
12
|
-
_columns = [];
|
|
13
|
-
_action;
|
|
14
|
-
_entity;
|
|
15
|
-
update(entity) {
|
|
16
|
-
this._entity = entity;
|
|
17
|
-
this._action = 'update';
|
|
18
|
-
return this._queryProcessor(this);
|
|
19
|
-
}
|
|
20
|
-
delete() {
|
|
21
|
-
this._action = 'delete';
|
|
22
|
-
return this._queryProcessor(this);
|
|
23
|
-
}
|
|
24
|
-
count() {
|
|
25
|
-
this._columns = [this._table.$all.count()];
|
|
26
|
-
this._action = 'select';
|
|
27
|
-
return this._queryProcessor(this).then((rows) => rows[0]);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.default = TableConditionQuery;
|
|
31
|
-
//# sourceMappingURL=table-condition-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table-condition-query.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAMA,MAAqB,mBAAmB;IAGtB;IACA;IACA;IAHd,YACc,eAA+B,EAC/B,MAAa,EACb,WAAoC;QAFpC,oBAAe,GAAf,eAAe,CAAgB;QAC/B,WAAM,GAAN,MAAM,CAAO;QACb,gBAAW,GAAX,WAAW,CAAyB;IAC/C,CAAC;IAEM,QAAQ,GAA8B,EAAE,CAAC;IACzC,OAAO,CAAc;IACrB,OAAO,CAA2B;IAE5C,MAAM,CAAC,MAAuB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,MAAM;QACF,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,KAAK;QACD,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;CACJ;AA5BD,sCA4BC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import QueryTable from "../query-table";
|
|
2
|
-
import TableConditionQuery from "./table-condition-query";
|
|
3
|
-
import QueryCondition from "../condition/query-condition";
|
|
4
|
-
import QueryColumn from "../column/query-column";
|
|
5
|
-
import { QueryProcessor, QueryAction } from "../helpers/internal-types";
|
|
6
|
-
export default class TableQuery<Entity, Id, Table extends QueryTable<Entity, Id>> {
|
|
7
|
-
protected _queryProcessor: QueryProcessor;
|
|
8
|
-
protected _table: Table;
|
|
9
|
-
constructor(_queryProcessor: QueryProcessor, _table: Table);
|
|
10
|
-
protected _entity: Entity | Entity[] | Partial<Entity>;
|
|
11
|
-
protected _action: QueryAction;
|
|
12
|
-
protected _columns: QueryColumn<Table, any>[];
|
|
13
|
-
where(...conditions: QueryCondition<Table>[]): TableConditionQuery<Entity, Table>;
|
|
14
|
-
insert(entity: Entity): Promise<any>;
|
|
15
|
-
insert(entities: Entity[]): Promise<void>;
|
|
16
|
-
deleteAll(): Promise<number>;
|
|
17
|
-
updateAll(entity: Partial<Entity>): Promise<number>;
|
|
18
|
-
countAll(): Promise<number>;
|
|
19
|
-
delete(id: Id): Promise<boolean>;
|
|
20
|
-
update(id: Id, entity: Partial<Entity>): Promise<boolean>;
|
|
21
|
-
get(id: Id): Promise<Entity | undefined>;
|
|
22
|
-
_whereId(id: Id): TableConditionQuery<Entity, Table>;
|
|
23
|
-
}
|