@riao/dbal 3.8.0 → 3.8.1
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/CHANGELOG.md +3 -3
- package/LICENSE.md +20 -20
- package/README.md +148 -148
- package/builder/builder.d.ts +7 -7
- package/builder/builder.js +19 -19
- package/builder/index.d.ts +2 -2
- package/builder/index.js +7 -7
- package/builder/sql-builder.d.ts +53 -53
- package/builder/sql-builder.js +157 -157
- package/builder/statement-builder.d.ts +12 -12
- package/builder/statement-builder.js +32 -32
- package/column/column-options.d.ts +156 -156
- package/column/column-options.js +2 -2
- package/column/column-type.d.ts +18 -18
- package/column/column-type.js +27 -27
- package/column/column-values.d.ts +34 -34
- package/column/column-values.js +2 -2
- package/column/index.d.ts +3 -3
- package/column/index.js +19 -19
- package/column-pack/date-time/create-timestamp-column.d.ts +2 -2
- package/column-pack/date-time/create-timestamp-column.js +10 -10
- package/column-pack/date-time/index.d.ts +2 -2
- package/column-pack/date-time/index.js +7 -7
- package/column-pack/date-time/update-timestamp-column.d.ts +2 -2
- package/column-pack/date-time/update-timestamp-column.js +14 -14
- package/column-pack/index.d.ts +6 -6
- package/column-pack/index.js +22 -22
- package/column-pack/keys/big-int-key-column.d.ts +2 -2
- package/column-pack/keys/big-int-key-column.js +10 -10
- package/column-pack/keys/index.d.ts +3 -3
- package/column-pack/keys/index.js +9 -9
- package/column-pack/keys/int-key-column.d.ts +2 -2
- package/column-pack/keys/int-key-column.js +10 -10
- package/column-pack/keys/uuid-key-column.d.ts +2 -2
- package/column-pack/keys/uuid-key-column.js +11 -11
- package/column-pack/person/date-of-birth-column.d.ts +2 -2
- package/column-pack/person/date-of-birth-column.js +8 -8
- package/column-pack/person/first-name-column.d.ts +2 -2
- package/column-pack/person/first-name-column.js +9 -9
- package/column-pack/person/index.d.ts +3 -3
- package/column-pack/person/index.js +9 -9
- package/column-pack/person/last-name-column.d.ts +2 -2
- package/column-pack/person/last-name-column.js +9 -9
- package/column-pack/resource/content-column.d.ts +2 -2
- package/column-pack/resource/content-column.js +9 -9
- package/column-pack/resource/description-column.d.ts +2 -2
- package/column-pack/resource/description-column.js +9 -9
- package/column-pack/resource/index.d.ts +6 -6
- package/column-pack/resource/index.js +15 -15
- package/column-pack/resource/is-active-column.d.ts +2 -2
- package/column-pack/resource/is-active-column.js +9 -9
- package/column-pack/resource/name-column.d.ts +2 -2
- package/column-pack/resource/name-column.js +10 -10
- package/column-pack/resource/path-column.d.ts +2 -2
- package/column-pack/resource/path-column.js +11 -11
- package/column-pack/resource/title-column.d.ts +2 -2
- package/column-pack/resource/title-column.js +10 -10
- package/column-pack/system/filename-column.d.ts +2 -2
- package/column-pack/system/filename-column.js +9 -9
- package/column-pack/system/filepath-column.d.ts +2 -2
- package/column-pack/system/filepath-column.js +9 -9
- package/column-pack/system/index.d.ts +4 -4
- package/column-pack/system/index.js +11 -11
- package/column-pack/system/ip-address-column.d.ts +2 -2
- package/column-pack/system/ip-address-column.js +9 -9
- package/column-pack/system/url-column.d.ts +3 -3
- package/column-pack/system/url-column.js +13 -13
- package/column-pack/user/email-column.d.ts +2 -2
- package/column-pack/user/email-column.js +11 -11
- package/column-pack/user/index.d.ts +4 -4
- package/column-pack/user/index.js +11 -11
- package/column-pack/user/password-column.d.ts +2 -2
- package/column-pack/user/password-column.js +10 -10
- package/column-pack/user/temp-email-column.d.ts +2 -2
- package/column-pack/user/temp-email-column.js +5 -5
- package/column-pack/user/username-column.d.ts +2 -2
- package/column-pack/user/username-column.js +11 -11
- package/comparison/comparison-aliases.d.ts +10 -10
- package/comparison/comparison-aliases.js +40 -40
- package/comparison/comparison-token.d.ts +17 -17
- package/comparison/comparison-token.js +15 -15
- package/comparison/comparison.d.ts +13 -13
- package/comparison/comparison.js +71 -71
- package/comparison/index.d.ts +4 -4
- package/comparison/index.js +24 -24
- package/comparison/is-comparison-token.d.ts +2 -2
- package/comparison/is-comparison-token.js +8 -8
- package/config/configure-db.d.ts +14 -14
- package/config/configure-db.js +18 -18
- package/config/database-env.d.ts +16 -16
- package/config/database-env.js +14 -14
- package/config/index.d.ts +2 -2
- package/config/index.js +7 -7
- package/database/connection-options.d.ts +7 -7
- package/database/connection-options.js +2 -2
- package/database/database.d.ts +204 -204
- package/database/database.js +330 -330
- package/database/driver-query.d.ts +10 -10
- package/database/driver-query.js +2 -2
- package/database/driver.d.ts +12 -12
- package/database/driver.js +47 -47
- package/database/get-database-path.d.ts +6 -6
- package/database/get-database-path.js +12 -12
- package/database/index.d.ts +7 -7
- package/database/index.js +26 -26
- package/database/load-database.d.ts +9 -9
- package/database/load-database.js +36 -36
- package/database/transaction.d.ts +8 -8
- package/database/transaction.js +2 -2
- package/ddl/alter-table.d.ts +26 -26
- package/ddl/alter-table.js +2 -2
- package/ddl/create-database.d.ts +3 -3
- package/ddl/create-database.js +2 -2
- package/ddl/create-index.d.ts +5 -5
- package/ddl/create-index.js +2 -2
- package/ddl/create-table.d.ts +8 -8
- package/ddl/create-table.js +2 -2
- package/ddl/create-user.d.ts +4 -4
- package/ddl/create-user.js +2 -2
- package/ddl/ddl-builder.d.ts +96 -96
- package/ddl/ddl-builder.js +565 -565
- package/ddl/ddl-repository.d.ts +135 -135
- package/ddl/ddl-repository.js +228 -228
- package/ddl/drop-database.d.ts +4 -4
- package/ddl/drop-database.js +2 -2
- package/ddl/drop-table.d.ts +4 -4
- package/ddl/drop-table.js +2 -2
- package/ddl/drop-user.d.ts +4 -4
- package/ddl/drop-user.js +2 -2
- package/ddl/foreign-key-constraint.d.ts +19 -19
- package/ddl/foreign-key-constraint.js +2 -2
- package/ddl/grant.d.ts +12 -12
- package/ddl/grant.js +2 -2
- package/ddl/index.d.ts +13 -13
- package/ddl/index.js +23 -23
- package/ddl/truncate.d.ts +3 -3
- package/ddl/truncate.js +2 -2
- package/dml/case-expression.d.ts +16 -16
- package/dml/case-expression.js +11 -11
- package/dml/delete.d.ts +8 -8
- package/dml/delete.js +2 -2
- package/dml/from.d.ts +4 -4
- package/dml/from.js +2 -2
- package/dml/group-by.d.ts +4 -4
- package/dml/group-by.js +2 -2
- package/dml/index.d.ts +11 -11
- package/dml/index.js +30 -30
- package/dml/insert.d.ts +14 -14
- package/dml/insert.js +2 -2
- package/dml/join.d.ts +7 -7
- package/dml/join.js +2 -2
- package/dml/order-by.d.ts +2 -2
- package/dml/order-by.js +2 -2
- package/dml/query-builder.d.ts +106 -106
- package/dml/query-builder.js +797 -793
- package/dml/query-builder.js.map +1 -1
- package/dml/query-repository.d.ts +84 -84
- package/dml/query-repository.js +239 -225
- package/dml/query-repository.js.map +1 -1
- package/dml/select.d.ts +29 -29
- package/dml/select.js +2 -2
- package/dml/set-options.d.ts +5 -5
- package/dml/set-options.js +2 -2
- package/dml/subquery.d.ts +5 -5
- package/dml/subquery.js +10 -10
- package/dml/update.d.ts +11 -11
- package/dml/update.js +2 -2
- package/expression/expression-token.d.ts +11 -11
- package/expression/expression-token.js +12 -12
- package/expression/expression.d.ts +6 -6
- package/expression/expression.js +2 -2
- package/expression/identifier.d.ts +7 -7
- package/expression/identifier.js +15 -15
- package/expression/index.d.ts +7 -7
- package/expression/index.js +25 -25
- package/expression/is-expression-token.d.ts +2 -2
- package/expression/is-expression-token.js +7 -7
- package/expression/key-val-expression.d.ts +7 -7
- package/expression/key-val-expression.js +2 -2
- package/expression/literal.d.ts +3 -3
- package/expression/literal.js +2 -2
- package/expression/logical.d.ts +18 -18
- package/expression/logical.js +30 -30
- package/expression/math.d.ts +17 -17
- package/expression/math.js +36 -36
- package/expression/raw.d.ts +8 -8
- package/expression/raw.js +16 -16
- package/expression/simple-expression.d.ts +8 -8
- package/expression/simple-expression.js +2 -2
- package/functions/function-aliases.d.ts +4 -4
- package/functions/function-aliases.js +12 -12
- package/functions/function-token.d.ts +29 -29
- package/functions/function-token.js +15 -15
- package/functions/functions.d.ts +19 -19
- package/functions/functions.js +94 -94
- package/functions/index.d.ts +4 -4
- package/functions/index.js +22 -22
- package/functions/is-database-function.d.ts +8 -8
- package/functions/is-database-function.js +14 -14
- package/functions/signatures/count.d.ts +14 -11
- package/functions/signatures/count.js +2 -2
- package/index.d.ts +16 -16
- package/index.js +32 -32
- package/migration/index.d.ts +3 -3
- package/migration/index.js +9 -9
- package/migration/migration-package.d.ts +14 -14
- package/migration/migration-package.js +10 -10
- package/migration/migration-record.d.ts +10 -10
- package/migration/migration-record.js +2 -2
- package/migration/migration-runner.d.ts +33 -33
- package/migration/migration-runner.js +180 -180
- package/migration/migration.d.ts +12 -12
- package/migration/migration.js +27 -27
- package/migration/migrations/001-create-migration-table.d.ts +8 -8
- package/migration/migrations/001-create-migration-table.js +54 -54
- package/migration/migrations/002-add-migration-package-column.d.ts +9 -9
- package/migration/migrations/002-add-migration-package-column.js +44 -44
- package/package.json +1 -1
- package/record/index.d.ts +1 -1
- package/record/index.js +17 -17
- package/record/record.d.ts +2 -2
- package/record/record.js +2 -2
- package/repository/index.d.ts +2 -2
- package/repository/index.js +5 -5
- package/repository/repository-options.d.ts +6 -6
- package/repository/repository-options.js +2 -2
- package/repository/repository.d.ts +29 -29
- package/repository/repository.js +68 -68
- package/schema/index.d.ts +3 -3
- package/schema/index.js +5 -5
- package/schema/schema-query-repository.d.ts +54 -54
- package/schema/schema-query-repository.js +159 -159
- package/schema/schema-table.d.ts +9 -9
- package/schema/schema-table.js +2 -2
- package/schema/schema.d.ts +4 -4
- package/schema/schema.js +2 -2
- package/seed/auto-seed.d.ts +9 -9
- package/seed/auto-seed.js +61 -61
- package/seed/create-seed-table.d.ts +8 -8
- package/seed/create-seed-table.js +64 -64
- package/seed/index.d.ts +4 -4
- package/seed/index.js +9 -9
- package/seed/seed-record.d.ts +11 -11
- package/seed/seed-record.js +2 -2
- package/seed/seed-runner.d.ts +20 -20
- package/seed/seed-runner.js +91 -91
- package/seed/seed.d.ts +12 -12
- package/seed/seed.js +27 -27
- package/tokens/index.d.ts +1 -1
- package/tokens/index.js +5 -5
- package/triggers/index.d.ts +2 -2
- package/triggers/index.js +18 -18
- package/triggers/prebuilt/index.d.ts +1 -1
- package/triggers/prebuilt/index.js +5 -5
- package/triggers/prebuilt/update-timestamp-trigger.d.ts +16 -16
- package/triggers/prebuilt/update-timestamp-trigger.js +24 -24
- package/triggers/trigger-options.d.ts +22 -22
- package/triggers/trigger-options.js +2 -2
- package/triggers/trigger.d.ts +19 -19
- package/triggers/trigger.js +23 -23
package/ddl/truncate.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface TruncateOptions {
|
|
2
|
-
table: string;
|
|
3
|
-
}
|
|
1
|
+
export interface TruncateOptions {
|
|
2
|
+
table: string;
|
|
3
|
+
}
|
package/ddl/truncate.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=truncate.js.map
|
package/dml/case-expression.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Expression } from '../expression';
|
|
2
|
-
export interface CaseCondition {
|
|
3
|
-
when: Expression;
|
|
4
|
-
then: Expression;
|
|
5
|
-
}
|
|
6
|
-
export interface CaseExpressionInterface {
|
|
7
|
-
value?: Expression;
|
|
8
|
-
case: CaseCondition[];
|
|
9
|
-
else?: Expression;
|
|
10
|
-
}
|
|
11
|
-
export declare class CaseExpression implements CaseExpressionInterface {
|
|
12
|
-
value?: Expression;
|
|
13
|
-
case: CaseCondition[];
|
|
14
|
-
else?: Expression;
|
|
15
|
-
constructor(expr: CaseExpressionInterface);
|
|
16
|
-
}
|
|
1
|
+
import { Expression } from '../expression';
|
|
2
|
+
export interface CaseCondition {
|
|
3
|
+
when: Expression;
|
|
4
|
+
then: Expression;
|
|
5
|
+
}
|
|
6
|
+
export interface CaseExpressionInterface {
|
|
7
|
+
value?: Expression;
|
|
8
|
+
case: CaseCondition[];
|
|
9
|
+
else?: Expression;
|
|
10
|
+
}
|
|
11
|
+
export declare class CaseExpression implements CaseExpressionInterface {
|
|
12
|
+
value?: Expression;
|
|
13
|
+
case: CaseCondition[];
|
|
14
|
+
else?: Expression;
|
|
15
|
+
constructor(expr: CaseExpressionInterface);
|
|
16
|
+
}
|
package/dml/case-expression.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CaseExpression = void 0;
|
|
4
|
-
class CaseExpression {
|
|
5
|
-
constructor(expr) {
|
|
6
|
-
this.value = expr.value;
|
|
7
|
-
this.case = expr.case;
|
|
8
|
-
this.else = expr.else;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.CaseExpression = CaseExpression;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CaseExpression = void 0;
|
|
4
|
+
class CaseExpression {
|
|
5
|
+
constructor(expr) {
|
|
6
|
+
this.value = expr.value;
|
|
7
|
+
this.case = expr.case;
|
|
8
|
+
this.else = expr.else;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.CaseExpression = CaseExpression;
|
|
12
12
|
//# sourceMappingURL=case-expression.js.map
|
package/dml/delete.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Expression } from '../expression';
|
|
2
|
-
import { DatabaseRecord } from '../record';
|
|
3
|
-
import { Join } from './join';
|
|
4
|
-
export interface DeleteOptions<T extends DatabaseRecord = DatabaseRecord> {
|
|
5
|
-
table?: string;
|
|
6
|
-
join?: Join[];
|
|
7
|
-
where: Expression<T>;
|
|
8
|
-
}
|
|
1
|
+
import { Expression } from '../expression';
|
|
2
|
+
import { DatabaseRecord } from '../record';
|
|
3
|
+
import { Join } from './join';
|
|
4
|
+
export interface DeleteOptions<T extends DatabaseRecord = DatabaseRecord> {
|
|
5
|
+
table?: string;
|
|
6
|
+
join?: Join[];
|
|
7
|
+
where: Expression<T>;
|
|
8
|
+
}
|
package/dml/delete.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=delete.js.map
|
package/dml/from.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Expression } from '../expression';
|
|
2
|
-
export type FromTable = string;
|
|
3
|
-
export type FromExpressions = Record<string, FromTable | Expression>;
|
|
4
|
-
export type From = FromTable | FromExpressions;
|
|
1
|
+
import { Expression } from '../expression';
|
|
2
|
+
export type FromTable = string;
|
|
3
|
+
export type FromExpressions = Record<string, FromTable | Expression>;
|
|
4
|
+
export type From = FromTable | FromExpressions;
|
package/dml/from.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=from.js.map
|
package/dml/group-by.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatabaseRecord } from '../record';
|
|
2
|
-
type AllowedKeys<T extends DatabaseRecord = DatabaseRecord> = keyof T & string;
|
|
3
|
-
export type GroupBy<T extends DatabaseRecord = DatabaseRecord> = AllowedKeys<T>[];
|
|
4
|
-
export {};
|
|
1
|
+
import { DatabaseRecord } from '../record';
|
|
2
|
+
type AllowedKeys<T extends DatabaseRecord = DatabaseRecord> = keyof T & string;
|
|
3
|
+
export type GroupBy<T extends DatabaseRecord = DatabaseRecord> = AllowedKeys<T>[];
|
|
4
|
+
export {};
|
package/dml/group-by.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=group-by.js.map
|
package/dml/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { DatabaseQueryBuilder } from './query-builder';
|
|
2
|
-
export { QueryRepository, QueryRepositoryOptions } from './query-repository';
|
|
3
|
-
export * from './case-expression';
|
|
4
|
-
export * from './delete';
|
|
5
|
-
export * from './insert';
|
|
6
|
-
export * from './join';
|
|
7
|
-
export * from './group-by';
|
|
8
|
-
export * from './order-by';
|
|
9
|
-
export * from './select';
|
|
10
|
-
export * from './subquery';
|
|
11
|
-
export * from './update';
|
|
1
|
+
export { DatabaseQueryBuilder } from './query-builder';
|
|
2
|
+
export { QueryRepository, QueryRepositoryOptions } from './query-repository';
|
|
3
|
+
export * from './case-expression';
|
|
4
|
+
export * from './delete';
|
|
5
|
+
export * from './insert';
|
|
6
|
+
export * from './join';
|
|
7
|
+
export * from './group-by';
|
|
8
|
+
export * from './order-by';
|
|
9
|
+
export * from './select';
|
|
10
|
+
export * from './subquery';
|
|
11
|
+
export * from './update';
|
package/dml/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.QueryRepository = exports.DatabaseQueryBuilder = void 0;
|
|
18
|
-
var query_builder_1 = require("./query-builder");
|
|
19
|
-
Object.defineProperty(exports, "DatabaseQueryBuilder", { enumerable: true, get: function () { return query_builder_1.DatabaseQueryBuilder; } });
|
|
20
|
-
var query_repository_1 = require("./query-repository");
|
|
21
|
-
Object.defineProperty(exports, "QueryRepository", { enumerable: true, get: function () { return query_repository_1.QueryRepository; } });
|
|
22
|
-
__exportStar(require("./case-expression"), exports);
|
|
23
|
-
__exportStar(require("./delete"), exports);
|
|
24
|
-
__exportStar(require("./insert"), exports);
|
|
25
|
-
__exportStar(require("./join"), exports);
|
|
26
|
-
__exportStar(require("./group-by"), exports);
|
|
27
|
-
__exportStar(require("./order-by"), exports);
|
|
28
|
-
__exportStar(require("./select"), exports);
|
|
29
|
-
__exportStar(require("./subquery"), exports);
|
|
30
|
-
__exportStar(require("./update"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.QueryRepository = exports.DatabaseQueryBuilder = void 0;
|
|
18
|
+
var query_builder_1 = require("./query-builder");
|
|
19
|
+
Object.defineProperty(exports, "DatabaseQueryBuilder", { enumerable: true, get: function () { return query_builder_1.DatabaseQueryBuilder; } });
|
|
20
|
+
var query_repository_1 = require("./query-repository");
|
|
21
|
+
Object.defineProperty(exports, "QueryRepository", { enumerable: true, get: function () { return query_repository_1.QueryRepository; } });
|
|
22
|
+
__exportStar(require("./case-expression"), exports);
|
|
23
|
+
__exportStar(require("./delete"), exports);
|
|
24
|
+
__exportStar(require("./insert"), exports);
|
|
25
|
+
__exportStar(require("./join"), exports);
|
|
26
|
+
__exportStar(require("./group-by"), exports);
|
|
27
|
+
__exportStar(require("./order-by"), exports);
|
|
28
|
+
__exportStar(require("./select"), exports);
|
|
29
|
+
__exportStar(require("./subquery"), exports);
|
|
30
|
+
__exportStar(require("./update"), exports);
|
|
31
31
|
//# sourceMappingURL=index.js.map
|
package/dml/insert.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { DatabaseRecord } from '../record';
|
|
2
|
-
export interface BaseInsertOptions<T extends DatabaseRecord = DatabaseRecord> {
|
|
3
|
-
table?: string;
|
|
4
|
-
ifNotExists?: boolean;
|
|
5
|
-
onDuplicateKeyUpdate?: Partial<T>;
|
|
6
|
-
primaryKey?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface InsertOptions<T extends DatabaseRecord = DatabaseRecord> extends BaseInsertOptions<T> {
|
|
9
|
-
records: Partial<T> | Partial<T>[];
|
|
10
|
-
}
|
|
11
|
-
export interface InsertOneOptions<T extends DatabaseRecord = DatabaseRecord> extends BaseInsertOptions<T> {
|
|
12
|
-
record: Partial<T>;
|
|
13
|
-
ignoreReturnId?: boolean;
|
|
14
|
-
}
|
|
1
|
+
import { DatabaseRecord } from '../record';
|
|
2
|
+
export interface BaseInsertOptions<T extends DatabaseRecord = DatabaseRecord> {
|
|
3
|
+
table?: string;
|
|
4
|
+
ifNotExists?: boolean;
|
|
5
|
+
onDuplicateKeyUpdate?: Partial<T>;
|
|
6
|
+
primaryKey?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface InsertOptions<T extends DatabaseRecord = DatabaseRecord> extends BaseInsertOptions<T> {
|
|
9
|
+
records: Partial<T> | Partial<T>[];
|
|
10
|
+
}
|
|
11
|
+
export interface InsertOneOptions<T extends DatabaseRecord = DatabaseRecord> extends BaseInsertOptions<T> {
|
|
12
|
+
record: Partial<T>;
|
|
13
|
+
ignoreReturnId?: boolean;
|
|
14
|
+
}
|
package/dml/insert.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=insert.js.map
|
package/dml/join.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Expression } from '../expression';
|
|
2
|
-
export interface Join {
|
|
3
|
-
type?: 'LEFT' | 'RIGHT' | 'INNER' | 'CROSS';
|
|
4
|
-
table: string;
|
|
5
|
-
alias?: string;
|
|
6
|
-
on?: Expression;
|
|
7
|
-
}
|
|
1
|
+
import { Expression } from '../expression';
|
|
2
|
+
export interface Join {
|
|
3
|
+
type?: 'LEFT' | 'RIGHT' | 'INNER' | 'CROSS';
|
|
4
|
+
table: string;
|
|
5
|
+
alias?: string;
|
|
6
|
+
on?: Expression;
|
|
7
|
+
}
|
package/dml/join.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=join.js.map
|
package/dml/order-by.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DatabaseRecord } from '../record';
|
|
2
|
-
export type OrderBy<T extends DatabaseRecord = DatabaseRecord> = Partial<Record<keyof T, 'ASC' | 'DESC'>>;
|
|
1
|
+
import { DatabaseRecord } from '../record';
|
|
2
|
+
export type OrderBy<T extends DatabaseRecord = DatabaseRecord> = Partial<Record<keyof T, 'ASC' | 'DESC'>>;
|
package/dml/order-by.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=order-by.js.map
|
package/dml/query-builder.d.ts
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
import { InsertOptions } from './insert';
|
|
2
|
-
import { SelectColumn, SelectQuery } from './select';
|
|
3
|
-
import { UpdateOptions } from './update';
|
|
4
|
-
import { DeleteOptions } from './delete';
|
|
5
|
-
import { StatementBuilder } from '../builder/statement-builder';
|
|
6
|
-
import { GroupBy } from './group-by';
|
|
7
|
-
import { OrderBy } from './order-by';
|
|
8
|
-
import { Join } from './join';
|
|
9
|
-
import { ComparisonToken } from '../comparison';
|
|
10
|
-
import { Expression, LogicalToken, MathToken, RawExpressionToken } from '../expression';
|
|
11
|
-
import { DatabaseFunction } from '../functions/function-token';
|
|
12
|
-
import { Subquery } from './subquery';
|
|
13
|
-
import { KeyValExpression } from '../expression/key-val-expression';
|
|
14
|
-
import { CaseExpression } from './case-expression';
|
|
15
|
-
import { SetOptions } from './set-options';
|
|
16
|
-
import { From } from './from';
|
|
17
|
-
export declare class DatabaseQueryBuilder extends StatementBuilder {
|
|
18
|
-
expression(expr: Expression | LogicalToken): void;
|
|
19
|
-
subquery(subquery: Subquery): void;
|
|
20
|
-
caseExpression(expr: CaseExpression): void;
|
|
21
|
-
rawExpression(expr: RawExpressionToken): this;
|
|
22
|
-
keyValueExpression(kv: KeyValExpression): this;
|
|
23
|
-
set(options: SetOptions): this;
|
|
24
|
-
setStatement(): this;
|
|
25
|
-
setColumn(options: SetOptions): this;
|
|
26
|
-
selectColumn(column: SelectColumn): this;
|
|
27
|
-
selectColumnList(columns?: SelectColumn[]): this;
|
|
28
|
-
selectFrom(from: From): this;
|
|
29
|
-
tableAlias(alias: string): this;
|
|
30
|
-
selectStatement(): this;
|
|
31
|
-
distinctStatement(): this;
|
|
32
|
-
selectTop(limit: number): this;
|
|
33
|
-
equal(value: Expression): void;
|
|
34
|
-
like(value: Expression): void;
|
|
35
|
-
lt(value: Expression): void;
|
|
36
|
-
lte(value: Expression): void;
|
|
37
|
-
gt(value: Expression): void;
|
|
38
|
-
gte(value: Expression): void;
|
|
39
|
-
notEqual(value: Expression): void;
|
|
40
|
-
isNull(): void;
|
|
41
|
-
inArray(values: Expression[]): void;
|
|
42
|
-
between(a: Expression, b: Expression): void;
|
|
43
|
-
notNull(): void;
|
|
44
|
-
buildComparisonToken(condition: ComparisonToken): this;
|
|
45
|
-
and(): void;
|
|
46
|
-
or(): void;
|
|
47
|
-
not(value: Expression): void;
|
|
48
|
-
logical(token: LogicalToken): void;
|
|
49
|
-
addition(): void;
|
|
50
|
-
subtraction(): void;
|
|
51
|
-
multiplication(): void;
|
|
52
|
-
division(): void;
|
|
53
|
-
modulo(): void;
|
|
54
|
-
math(token: MathToken): void;
|
|
55
|
-
where(where: Expression): this;
|
|
56
|
-
limit(nRecords: number): this;
|
|
57
|
-
offset(nRecords: number): this;
|
|
58
|
-
groupBy(by: GroupBy): this;
|
|
59
|
-
having(query: Expression): this;
|
|
60
|
-
orderBy(by: OrderBy): void;
|
|
61
|
-
select(query: SelectQuery): this;
|
|
62
|
-
pagination(query: SelectQuery): this;
|
|
63
|
-
join(join: Join): void;
|
|
64
|
-
insertIntoStatement(table: string): this;
|
|
65
|
-
insertColumnNames(record: Record<string, Expression>): this;
|
|
66
|
-
insertOnDuplicateKeyUpdate(assignment: Record<string, Expression>): this;
|
|
67
|
-
insertIfNotExists(): this;
|
|
68
|
-
insertOutput(primaryKey: string): this;
|
|
69
|
-
insertReturning(primaryKey: string): this;
|
|
70
|
-
insert(options: InsertOptions): this;
|
|
71
|
-
updateStatement(table: string): this;
|
|
72
|
-
updateKeyValues(values: {
|
|
73
|
-
[key: string]: Expression;
|
|
74
|
-
}): this;
|
|
75
|
-
updateSetStatement(values: {
|
|
76
|
-
[key: string]: Expression;
|
|
77
|
-
}): this;
|
|
78
|
-
update(options: UpdateOptions): this;
|
|
79
|
-
deleteStatement(table: string): this;
|
|
80
|
-
delete(options: DeleteOptions): this;
|
|
81
|
-
/**
|
|
82
|
-
* Append a database function the query
|
|
83
|
-
*
|
|
84
|
-
* @param fn Database function token
|
|
85
|
-
*/
|
|
86
|
-
databaseFunction(fn: DatabaseFunction): this;
|
|
87
|
-
average(fn: DatabaseFunction): this;
|
|
88
|
-
count(fn: DatabaseFunction): this;
|
|
89
|
-
min(fn: DatabaseFunction): this;
|
|
90
|
-
max(fn: DatabaseFunction): this;
|
|
91
|
-
sum(fn: DatabaseFunction): this;
|
|
92
|
-
currentTimestamp(fn: DatabaseFunction): this;
|
|
93
|
-
date(fn: DatabaseFunction): this;
|
|
94
|
-
year(fn: DatabaseFunction): this;
|
|
95
|
-
uuid(): this;
|
|
96
|
-
getTriggerOld(): string;
|
|
97
|
-
getTriggerOldColumn(column: string): string;
|
|
98
|
-
getTriggerNew(): string;
|
|
99
|
-
getTriggerNewColumn(column: string): string;
|
|
100
|
-
triggerSetValue(options: {
|
|
101
|
-
table: string;
|
|
102
|
-
idColumn: string;
|
|
103
|
-
column: string;
|
|
104
|
-
value: Expression;
|
|
105
|
-
}): this;
|
|
106
|
-
}
|
|
1
|
+
import { InsertOptions } from './insert';
|
|
2
|
+
import { SelectColumn, SelectQuery } from './select';
|
|
3
|
+
import { UpdateOptions } from './update';
|
|
4
|
+
import { DeleteOptions } from './delete';
|
|
5
|
+
import { StatementBuilder } from '../builder/statement-builder';
|
|
6
|
+
import { GroupBy } from './group-by';
|
|
7
|
+
import { OrderBy } from './order-by';
|
|
8
|
+
import { Join } from './join';
|
|
9
|
+
import { ComparisonToken } from '../comparison';
|
|
10
|
+
import { Expression, LogicalToken, MathToken, RawExpressionToken } from '../expression';
|
|
11
|
+
import { DatabaseFunction } from '../functions/function-token';
|
|
12
|
+
import { Subquery } from './subquery';
|
|
13
|
+
import { KeyValExpression } from '../expression/key-val-expression';
|
|
14
|
+
import { CaseExpression } from './case-expression';
|
|
15
|
+
import { SetOptions } from './set-options';
|
|
16
|
+
import { From } from './from';
|
|
17
|
+
export declare class DatabaseQueryBuilder extends StatementBuilder {
|
|
18
|
+
expression(expr: Expression | LogicalToken): void;
|
|
19
|
+
subquery(subquery: Subquery): void;
|
|
20
|
+
caseExpression(expr: CaseExpression): void;
|
|
21
|
+
rawExpression(expr: RawExpressionToken): this;
|
|
22
|
+
keyValueExpression(kv: KeyValExpression): this;
|
|
23
|
+
set(options: SetOptions): this;
|
|
24
|
+
setStatement(): this;
|
|
25
|
+
setColumn(options: SetOptions): this;
|
|
26
|
+
selectColumn(column: SelectColumn): this;
|
|
27
|
+
selectColumnList(columns?: SelectColumn[]): this;
|
|
28
|
+
selectFrom(from: From): this;
|
|
29
|
+
tableAlias(alias: string): this;
|
|
30
|
+
selectStatement(): this;
|
|
31
|
+
distinctStatement(): this;
|
|
32
|
+
selectTop(limit: number): this;
|
|
33
|
+
equal(value: Expression): void;
|
|
34
|
+
like(value: Expression): void;
|
|
35
|
+
lt(value: Expression): void;
|
|
36
|
+
lte(value: Expression): void;
|
|
37
|
+
gt(value: Expression): void;
|
|
38
|
+
gte(value: Expression): void;
|
|
39
|
+
notEqual(value: Expression): void;
|
|
40
|
+
isNull(): void;
|
|
41
|
+
inArray(values: Expression[]): void;
|
|
42
|
+
between(a: Expression, b: Expression): void;
|
|
43
|
+
notNull(): void;
|
|
44
|
+
buildComparisonToken(condition: ComparisonToken): this;
|
|
45
|
+
and(): void;
|
|
46
|
+
or(): void;
|
|
47
|
+
not(value: Expression): void;
|
|
48
|
+
logical(token: LogicalToken): void;
|
|
49
|
+
addition(): void;
|
|
50
|
+
subtraction(): void;
|
|
51
|
+
multiplication(): void;
|
|
52
|
+
division(): void;
|
|
53
|
+
modulo(): void;
|
|
54
|
+
math(token: MathToken): void;
|
|
55
|
+
where(where: Expression): this;
|
|
56
|
+
limit(nRecords: number): this;
|
|
57
|
+
offset(nRecords: number): this;
|
|
58
|
+
groupBy(by: GroupBy): this;
|
|
59
|
+
having(query: Expression): this;
|
|
60
|
+
orderBy(by: OrderBy): void;
|
|
61
|
+
select(query: SelectQuery): this;
|
|
62
|
+
pagination(query: SelectQuery): this;
|
|
63
|
+
join(join: Join): void;
|
|
64
|
+
insertIntoStatement(table: string): this;
|
|
65
|
+
insertColumnNames(record: Record<string, Expression>): this;
|
|
66
|
+
insertOnDuplicateKeyUpdate(assignment: Record<string, Expression>): this;
|
|
67
|
+
insertIfNotExists(): this;
|
|
68
|
+
insertOutput(primaryKey: string): this;
|
|
69
|
+
insertReturning(primaryKey: string): this;
|
|
70
|
+
insert(options: InsertOptions): this;
|
|
71
|
+
updateStatement(table: string): this;
|
|
72
|
+
updateKeyValues(values: {
|
|
73
|
+
[key: string]: Expression;
|
|
74
|
+
}): this;
|
|
75
|
+
updateSetStatement(values: {
|
|
76
|
+
[key: string]: Expression;
|
|
77
|
+
}): this;
|
|
78
|
+
update(options: UpdateOptions): this;
|
|
79
|
+
deleteStatement(table: string): this;
|
|
80
|
+
delete(options: DeleteOptions): this;
|
|
81
|
+
/**
|
|
82
|
+
* Append a database function the query
|
|
83
|
+
*
|
|
84
|
+
* @param fn Database function token
|
|
85
|
+
*/
|
|
86
|
+
databaseFunction(fn: DatabaseFunction): this;
|
|
87
|
+
average(fn: DatabaseFunction): this;
|
|
88
|
+
count(fn: DatabaseFunction): this;
|
|
89
|
+
min(fn: DatabaseFunction): this;
|
|
90
|
+
max(fn: DatabaseFunction): this;
|
|
91
|
+
sum(fn: DatabaseFunction): this;
|
|
92
|
+
currentTimestamp(fn: DatabaseFunction): this;
|
|
93
|
+
date(fn: DatabaseFunction): this;
|
|
94
|
+
year(fn: DatabaseFunction): this;
|
|
95
|
+
uuid(): this;
|
|
96
|
+
getTriggerOld(): string;
|
|
97
|
+
getTriggerOldColumn(column: string): string;
|
|
98
|
+
getTriggerNew(): string;
|
|
99
|
+
getTriggerNewColumn(column: string): string;
|
|
100
|
+
triggerSetValue(options: {
|
|
101
|
+
table: string;
|
|
102
|
+
idColumn: string;
|
|
103
|
+
column: string;
|
|
104
|
+
value: Expression;
|
|
105
|
+
}): this;
|
|
106
|
+
}
|