kysely 0.23.0 → 0.23.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/dist/cjs/schema/alter-table-builder.d.ts +1 -1
- package/dist/cjs/schema/alter-table-builder.js +3 -3
- package/dist/cjs/schema/create-index-builder.d.ts +1 -1
- package/dist/cjs/schema/create-index-builder.js +7 -7
- package/dist/cjs/schema/create-schema-builder.d.ts +1 -1
- package/dist/cjs/schema/create-schema-builder.js +2 -2
- package/dist/cjs/schema/create-table-builder.d.ts +1 -1
- package/dist/cjs/schema/create-table-builder.js +11 -11
- package/dist/cjs/schema/create-type-builder.d.ts +1 -1
- package/dist/cjs/schema/create-type-builder.js +2 -2
- package/dist/cjs/schema/create-view-builder.d.ts +1 -1
- package/dist/cjs/schema/create-view-builder.js +7 -7
- package/dist/cjs/schema/drop-index-builder.d.ts +1 -1
- package/dist/cjs/schema/drop-index-builder.js +4 -4
- package/dist/cjs/schema/drop-schema-builder.d.ts +1 -1
- package/dist/cjs/schema/drop-schema-builder.js +3 -3
- package/dist/cjs/schema/drop-table-builder.d.ts +1 -1
- package/dist/cjs/schema/drop-table-builder.js +3 -3
- package/dist/cjs/schema/drop-type-builder.d.ts +1 -1
- package/dist/cjs/schema/drop-type-builder.js +2 -2
- package/dist/cjs/schema/drop-view-builder.d.ts +1 -1
- package/dist/cjs/schema/drop-view-builder.js +4 -4
- package/dist/cjs/schema/schema.js +10 -10
- package/dist/esm/schema/alter-table-builder.d.ts +1 -1
- package/dist/esm/schema/alter-table-builder.js +3 -3
- package/dist/esm/schema/create-index-builder.d.ts +1 -1
- package/dist/esm/schema/create-index-builder.js +7 -7
- package/dist/esm/schema/create-schema-builder.d.ts +1 -1
- package/dist/esm/schema/create-schema-builder.js +2 -2
- package/dist/esm/schema/create-table-builder.d.ts +1 -1
- package/dist/esm/schema/create-table-builder.js +11 -11
- package/dist/esm/schema/create-type-builder.d.ts +1 -1
- package/dist/esm/schema/create-type-builder.js +2 -2
- package/dist/esm/schema/create-view-builder.d.ts +1 -1
- package/dist/esm/schema/create-view-builder.js +7 -7
- package/dist/esm/schema/drop-index-builder.d.ts +1 -1
- package/dist/esm/schema/drop-index-builder.js +4 -4
- package/dist/esm/schema/drop-schema-builder.d.ts +1 -1
- package/dist/esm/schema/drop-schema-builder.js +3 -3
- package/dist/esm/schema/drop-table-builder.d.ts +1 -1
- package/dist/esm/schema/drop-table-builder.js +3 -3
- package/dist/esm/schema/drop-type-builder.d.ts +1 -1
- package/dist/esm/schema/drop-type-builder.js +2 -2
- package/dist/esm/schema/drop-view-builder.d.ts +1 -1
- package/dist/esm/schema/drop-view-builder.js +4 -4
- package/dist/esm/schema/schema.js +10 -10
- package/package.json +1 -1
|
@@ -57,8 +57,8 @@ export declare class AlterTableBuilder implements ColumnAlteringInterface {
|
|
|
57
57
|
}
|
|
58
58
|
export interface AlterTableBuilderProps {
|
|
59
59
|
readonly queryId: QueryId;
|
|
60
|
-
readonly node: AlterTableNode;
|
|
61
60
|
readonly executor: QueryExecutor;
|
|
61
|
+
readonly node: AlterTableNode;
|
|
62
62
|
}
|
|
63
63
|
export declare class AlterTableExecutor implements OperationNodeSource, Compilable {
|
|
64
64
|
#private;
|
|
@@ -151,7 +151,7 @@ exports.AlterTableExecutor = AlterTableExecutor;
|
|
|
151
151
|
class AlterTableColumnAlteringBuilder {
|
|
152
152
|
#props;
|
|
153
153
|
constructor(props) {
|
|
154
|
-
this.#props = props;
|
|
154
|
+
this.#props = (0, object_utils_js_1.freeze)(props);
|
|
155
155
|
}
|
|
156
156
|
alterColumn(column, alteration) {
|
|
157
157
|
const builder = alteration(new alter_column_builder_js_1.AlterColumnBuilder(alter_column_node_js_1.AlterColumnNode.create(column)));
|
|
@@ -187,10 +187,10 @@ class AlterTableColumnAlteringBuilder {
|
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
toOperationNode() {
|
|
190
|
-
return this.#props.node;
|
|
190
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
191
191
|
}
|
|
192
192
|
compile() {
|
|
193
|
-
return this.#props.executor.compileQuery(this
|
|
193
|
+
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
194
194
|
}
|
|
195
195
|
async execute() {
|
|
196
196
|
await this.#props.executor.executeQuery(this.compile(), this.#props.queryId);
|
|
@@ -56,5 +56,5 @@ export declare class CreateIndexBuilder implements OperationNodeSource, Compilab
|
|
|
56
56
|
export interface CreateIndexBuilderProps {
|
|
57
57
|
readonly queryId: QueryId;
|
|
58
58
|
readonly executor: QueryExecutor;
|
|
59
|
-
readonly
|
|
59
|
+
readonly node: CreateIndexNode;
|
|
60
60
|
}
|
|
@@ -19,7 +19,7 @@ class CreateIndexBuilder {
|
|
|
19
19
|
unique() {
|
|
20
20
|
return new CreateIndexBuilder({
|
|
21
21
|
...this.#props,
|
|
22
|
-
|
|
22
|
+
node: create_index_node_js_1.CreateIndexNode.cloneWith(this.#props.node, {
|
|
23
23
|
unique: true,
|
|
24
24
|
}),
|
|
25
25
|
});
|
|
@@ -30,7 +30,7 @@ class CreateIndexBuilder {
|
|
|
30
30
|
on(table) {
|
|
31
31
|
return new CreateIndexBuilder({
|
|
32
32
|
...this.#props,
|
|
33
|
-
|
|
33
|
+
node: create_index_node_js_1.CreateIndexNode.cloneWith(this.#props.node, {
|
|
34
34
|
table: (0, table_parser_js_1.parseTable)(table),
|
|
35
35
|
}),
|
|
36
36
|
});
|
|
@@ -43,7 +43,7 @@ class CreateIndexBuilder {
|
|
|
43
43
|
column(column) {
|
|
44
44
|
return new CreateIndexBuilder({
|
|
45
45
|
...this.#props,
|
|
46
|
-
|
|
46
|
+
node: create_index_node_js_1.CreateIndexNode.cloneWith(this.#props.node, {
|
|
47
47
|
expression: (0, reference_parser_js_1.parseColumnName)(column),
|
|
48
48
|
}),
|
|
49
49
|
});
|
|
@@ -56,7 +56,7 @@ class CreateIndexBuilder {
|
|
|
56
56
|
columns(columns) {
|
|
57
57
|
return new CreateIndexBuilder({
|
|
58
58
|
...this.#props,
|
|
59
|
-
|
|
59
|
+
node: create_index_node_js_1.CreateIndexNode.cloneWith(this.#props.node, {
|
|
60
60
|
expression: list_node_js_1.ListNode.create(columns.map(reference_parser_js_1.parseColumnName)),
|
|
61
61
|
}),
|
|
62
62
|
});
|
|
@@ -79,7 +79,7 @@ class CreateIndexBuilder {
|
|
|
79
79
|
expression(expression) {
|
|
80
80
|
return new CreateIndexBuilder({
|
|
81
81
|
...this.#props,
|
|
82
|
-
|
|
82
|
+
node: create_index_node_js_1.CreateIndexNode.cloneWith(this.#props.node, {
|
|
83
83
|
expression: expression.toOperationNode(),
|
|
84
84
|
}),
|
|
85
85
|
});
|
|
@@ -87,13 +87,13 @@ class CreateIndexBuilder {
|
|
|
87
87
|
using(indexType) {
|
|
88
88
|
return new CreateIndexBuilder({
|
|
89
89
|
...this.#props,
|
|
90
|
-
|
|
90
|
+
node: create_index_node_js_1.CreateIndexNode.cloneWith(this.#props.node, {
|
|
91
91
|
using: raw_node_js_1.RawNode.createWithSql(indexType),
|
|
92
92
|
}),
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
toOperationNode() {
|
|
96
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
96
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
97
97
|
}
|
|
98
98
|
compile() {
|
|
99
99
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -15,5 +15,5 @@ export declare class CreateSchemaBuilder implements OperationNodeSource, Compila
|
|
|
15
15
|
export interface CreateSchemaBuilderProps {
|
|
16
16
|
readonly queryId: QueryId;
|
|
17
17
|
readonly executor: QueryExecutor;
|
|
18
|
-
readonly
|
|
18
|
+
readonly node: CreateSchemaNode;
|
|
19
19
|
}
|
|
@@ -12,11 +12,11 @@ class CreateSchemaBuilder {
|
|
|
12
12
|
ifNotExists() {
|
|
13
13
|
return new CreateSchemaBuilder({
|
|
14
14
|
...this.#props,
|
|
15
|
-
|
|
15
|
+
node: create_schema_node_js_1.CreateSchemaNode.cloneWith(this.#props.node, { ifNotExists: true }),
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
toOperationNode() {
|
|
19
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
19
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
20
20
|
}
|
|
21
21
|
compile() {
|
|
22
22
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -243,7 +243,7 @@ export declare class CreateTableBuilder<TB extends string, C extends string = ne
|
|
|
243
243
|
export interface CreateTableBuilderProps {
|
|
244
244
|
readonly queryId: QueryId;
|
|
245
245
|
readonly executor: QueryExecutor;
|
|
246
|
-
readonly
|
|
246
|
+
readonly node: CreateTableNode;
|
|
247
247
|
}
|
|
248
248
|
export declare type ColumnBuilderCallback = (builder: ColumnDefinitionBuilder) => ColumnDefinitionBuilder;
|
|
249
249
|
export declare type ForeignKeyConstraintBuilderCallback = (builder: ForeignKeyConstraintBuilder) => ForeignKeyConstraintBuilder;
|
|
@@ -31,7 +31,7 @@ class CreateTableBuilder {
|
|
|
31
31
|
temporary() {
|
|
32
32
|
return new CreateTableBuilder({
|
|
33
33
|
...this.#props,
|
|
34
|
-
|
|
34
|
+
node: create_table_node_js_1.CreateTableNode.cloneWith(this.#props.node, {
|
|
35
35
|
temporary: true,
|
|
36
36
|
}),
|
|
37
37
|
});
|
|
@@ -45,7 +45,7 @@ class CreateTableBuilder {
|
|
|
45
45
|
onCommit(onCommit) {
|
|
46
46
|
return new CreateTableBuilder({
|
|
47
47
|
...this.#props,
|
|
48
|
-
|
|
48
|
+
node: create_table_node_js_1.CreateTableNode.cloneWith(this.#props.node, {
|
|
49
49
|
onCommit: (0, on_commit_action_parse_js_1.parseOnCommitAction)(onCommit),
|
|
50
50
|
}),
|
|
51
51
|
});
|
|
@@ -58,7 +58,7 @@ class CreateTableBuilder {
|
|
|
58
58
|
ifNotExists() {
|
|
59
59
|
return new CreateTableBuilder({
|
|
60
60
|
...this.#props,
|
|
61
|
-
|
|
61
|
+
node: create_table_node_js_1.CreateTableNode.cloneWith(this.#props.node, {
|
|
62
62
|
ifNotExists: true,
|
|
63
63
|
}),
|
|
64
64
|
});
|
|
@@ -111,7 +111,7 @@ class CreateTableBuilder {
|
|
|
111
111
|
const columnBuilder = build(new column_definition_builder_js_1.ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.create(columnName, (0, data_type_parser_js_1.parseDataTypeExpression)(dataType))));
|
|
112
112
|
return new CreateTableBuilder({
|
|
113
113
|
...this.#props,
|
|
114
|
-
|
|
114
|
+
node: create_table_node_js_1.CreateTableNode.cloneWithColumn(this.#props.node, columnBuilder.toOperationNode()),
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
@@ -129,7 +129,7 @@ class CreateTableBuilder {
|
|
|
129
129
|
addPrimaryKeyConstraint(constraintName, columns) {
|
|
130
130
|
return new CreateTableBuilder({
|
|
131
131
|
...this.#props,
|
|
132
|
-
|
|
132
|
+
node: create_table_node_js_1.CreateTableNode.cloneWithConstraint(this.#props.node, primary_constraint_node_js_1.PrimaryConstraintNode.create(columns, constraintName)),
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
@@ -147,7 +147,7 @@ class CreateTableBuilder {
|
|
|
147
147
|
addUniqueConstraint(constraintName, columns) {
|
|
148
148
|
return new CreateTableBuilder({
|
|
149
149
|
...this.#props,
|
|
150
|
-
|
|
150
|
+
node: create_table_node_js_1.CreateTableNode.cloneWithConstraint(this.#props.node, unique_constraint_node_js_1.UniqueConstraintNode.create(columns, constraintName)),
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
@@ -167,7 +167,7 @@ class CreateTableBuilder {
|
|
|
167
167
|
addCheckConstraint(constraintName, checkExpression) {
|
|
168
168
|
return new CreateTableBuilder({
|
|
169
169
|
...this.#props,
|
|
170
|
-
|
|
170
|
+
node: create_table_node_js_1.CreateTableNode.cloneWithConstraint(this.#props.node, check_constraint_node_js_1.CheckConstraintNode.create(checkExpression.toOperationNode(), constraintName)),
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
@@ -203,7 +203,7 @@ class CreateTableBuilder {
|
|
|
203
203
|
const builder = build(new foreign_key_constraint_builder_js_1.ForeignKeyConstraintBuilder(foreign_key_constraint_node_js_1.ForeignKeyConstraintNode.create(columns.map(column_node_js_1.ColumnNode.create), (0, table_parser_js_1.parseTable)(targetTable), targetColumns.map(column_node_js_1.ColumnNode.create), constraintName)));
|
|
204
204
|
return new CreateTableBuilder({
|
|
205
205
|
...this.#props,
|
|
206
|
-
|
|
206
|
+
node: create_table_node_js_1.CreateTableNode.cloneWithConstraint(this.#props.node, builder.toOperationNode()),
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
@@ -235,7 +235,7 @@ class CreateTableBuilder {
|
|
|
235
235
|
modifyFront(modifier) {
|
|
236
236
|
return new CreateTableBuilder({
|
|
237
237
|
...this.#props,
|
|
238
|
-
|
|
238
|
+
node: create_table_node_js_1.CreateTableNode.cloneWithFrontModifier(this.#props.node, modifier.toOperationNode()),
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
@@ -267,7 +267,7 @@ class CreateTableBuilder {
|
|
|
267
267
|
modifyEnd(modifier) {
|
|
268
268
|
return new CreateTableBuilder({
|
|
269
269
|
...this.#props,
|
|
270
|
-
|
|
270
|
+
node: create_table_node_js_1.CreateTableNode.cloneWithEndModifier(this.#props.node, modifier.toOperationNode()),
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
@@ -306,7 +306,7 @@ class CreateTableBuilder {
|
|
|
306
306
|
return func(this);
|
|
307
307
|
}
|
|
308
308
|
toOperationNode() {
|
|
309
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
309
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
310
310
|
}
|
|
311
311
|
compile() {
|
|
312
312
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -24,5 +24,5 @@ export declare class CreateTypeBuilder implements OperationNodeSource, Compilabl
|
|
|
24
24
|
export interface CreateTypeBuilderProps {
|
|
25
25
|
readonly queryId: QueryId;
|
|
26
26
|
readonly executor: QueryExecutor;
|
|
27
|
-
readonly
|
|
27
|
+
readonly node: CreateTypeNode;
|
|
28
28
|
}
|
|
@@ -10,7 +10,7 @@ class CreateTypeBuilder {
|
|
|
10
10
|
this.#props = (0, object_utils_js_1.freeze)(props);
|
|
11
11
|
}
|
|
12
12
|
toOperationNode() {
|
|
13
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
13
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Creates an anum type.
|
|
@@ -24,7 +24,7 @@ class CreateTypeBuilder {
|
|
|
24
24
|
asEnum(values) {
|
|
25
25
|
return new CreateTypeBuilder({
|
|
26
26
|
...this.#props,
|
|
27
|
-
|
|
27
|
+
node: create_type_node_js_1.CreateTypeNode.cloneWithEnum(this.#props.node, values),
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
compile() {
|
|
@@ -39,5 +39,5 @@ export declare class CreateViewBuilder implements OperationNodeSource, Compilabl
|
|
|
39
39
|
export interface CreateViewBuilderProps {
|
|
40
40
|
readonly queryId: QueryId;
|
|
41
41
|
readonly executor: QueryExecutor;
|
|
42
|
-
readonly
|
|
42
|
+
readonly node: CreateViewNode;
|
|
43
43
|
}
|
|
@@ -19,7 +19,7 @@ class CreateViewBuilder {
|
|
|
19
19
|
temporary() {
|
|
20
20
|
return new CreateViewBuilder({
|
|
21
21
|
...this.#props,
|
|
22
|
-
|
|
22
|
+
node: create_view_node_js_1.CreateViewNode.cloneWith(this.#props.node, {
|
|
23
23
|
temporary: true,
|
|
24
24
|
}),
|
|
25
25
|
});
|
|
@@ -27,7 +27,7 @@ class CreateViewBuilder {
|
|
|
27
27
|
materialized() {
|
|
28
28
|
return new CreateViewBuilder({
|
|
29
29
|
...this.#props,
|
|
30
|
-
|
|
30
|
+
node: create_view_node_js_1.CreateViewNode.cloneWith(this.#props.node, {
|
|
31
31
|
materialized: true,
|
|
32
32
|
}),
|
|
33
33
|
});
|
|
@@ -38,7 +38,7 @@ class CreateViewBuilder {
|
|
|
38
38
|
ifNotExists() {
|
|
39
39
|
return new CreateViewBuilder({
|
|
40
40
|
...this.#props,
|
|
41
|
-
|
|
41
|
+
node: create_view_node_js_1.CreateViewNode.cloneWith(this.#props.node, {
|
|
42
42
|
ifNotExists: true,
|
|
43
43
|
}),
|
|
44
44
|
});
|
|
@@ -46,7 +46,7 @@ class CreateViewBuilder {
|
|
|
46
46
|
orReplace() {
|
|
47
47
|
return new CreateViewBuilder({
|
|
48
48
|
...this.#props,
|
|
49
|
-
|
|
49
|
+
node: create_view_node_js_1.CreateViewNode.cloneWith(this.#props.node, {
|
|
50
50
|
orReplace: true,
|
|
51
51
|
}),
|
|
52
52
|
});
|
|
@@ -54,7 +54,7 @@ class CreateViewBuilder {
|
|
|
54
54
|
columns(columns) {
|
|
55
55
|
return new CreateViewBuilder({
|
|
56
56
|
...this.#props,
|
|
57
|
-
|
|
57
|
+
node: create_view_node_js_1.CreateViewNode.cloneWith(this.#props.node, {
|
|
58
58
|
columns: columns.map(reference_parser_js_1.parseColumnName),
|
|
59
59
|
}),
|
|
60
60
|
});
|
|
@@ -74,13 +74,13 @@ class CreateViewBuilder {
|
|
|
74
74
|
.toOperationNode();
|
|
75
75
|
return new CreateViewBuilder({
|
|
76
76
|
...this.#props,
|
|
77
|
-
|
|
77
|
+
node: create_view_node_js_1.CreateViewNode.cloneWith(this.#props.node, {
|
|
78
78
|
as: queryNode,
|
|
79
79
|
}),
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
toOperationNode() {
|
|
83
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
83
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
84
84
|
}
|
|
85
85
|
compile() {
|
|
86
86
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -21,5 +21,5 @@ export declare class DropIndexBuilder implements OperationNodeSource, Compilable
|
|
|
21
21
|
export interface DropIndexBuilderProps {
|
|
22
22
|
readonly queryId: QueryId;
|
|
23
23
|
readonly executor: QueryExecutor;
|
|
24
|
-
readonly
|
|
24
|
+
readonly node: DropIndexNode;
|
|
25
25
|
}
|
|
@@ -17,7 +17,7 @@ class DropIndexBuilder {
|
|
|
17
17
|
on(table) {
|
|
18
18
|
return new DropIndexBuilder({
|
|
19
19
|
...this.#props,
|
|
20
|
-
|
|
20
|
+
node: drop_index_node_js_1.DropIndexNode.cloneWith(this.#props.node, {
|
|
21
21
|
table: (0, table_parser_js_1.parseTable)(table),
|
|
22
22
|
}),
|
|
23
23
|
});
|
|
@@ -25,7 +25,7 @@ class DropIndexBuilder {
|
|
|
25
25
|
ifExists() {
|
|
26
26
|
return new DropIndexBuilder({
|
|
27
27
|
...this.#props,
|
|
28
|
-
|
|
28
|
+
node: drop_index_node_js_1.DropIndexNode.cloneWith(this.#props.node, {
|
|
29
29
|
ifExists: true,
|
|
30
30
|
}),
|
|
31
31
|
});
|
|
@@ -33,13 +33,13 @@ class DropIndexBuilder {
|
|
|
33
33
|
cascade() {
|
|
34
34
|
return new DropIndexBuilder({
|
|
35
35
|
...this.#props,
|
|
36
|
-
|
|
36
|
+
node: drop_index_node_js_1.DropIndexNode.cloneWith(this.#props.node, {
|
|
37
37
|
cascade: true,
|
|
38
38
|
}),
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
toOperationNode() {
|
|
42
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
42
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
43
43
|
}
|
|
44
44
|
compile() {
|
|
45
45
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -16,5 +16,5 @@ export declare class DropSchemaBuilder implements OperationNodeSource, Compilabl
|
|
|
16
16
|
export interface DropSchemaBuilderProps {
|
|
17
17
|
readonly queryId: QueryId;
|
|
18
18
|
readonly executor: QueryExecutor;
|
|
19
|
-
readonly
|
|
19
|
+
readonly node: DropSchemaNode;
|
|
20
20
|
}
|
|
@@ -12,7 +12,7 @@ class DropSchemaBuilder {
|
|
|
12
12
|
ifExists() {
|
|
13
13
|
return new DropSchemaBuilder({
|
|
14
14
|
...this.#props,
|
|
15
|
-
|
|
15
|
+
node: drop_schema_node_js_1.DropSchemaNode.cloneWith(this.#props.node, {
|
|
16
16
|
ifExists: true,
|
|
17
17
|
}),
|
|
18
18
|
});
|
|
@@ -20,13 +20,13 @@ class DropSchemaBuilder {
|
|
|
20
20
|
cascade() {
|
|
21
21
|
return new DropSchemaBuilder({
|
|
22
22
|
...this.#props,
|
|
23
|
-
|
|
23
|
+
node: drop_schema_node_js_1.DropSchemaNode.cloneWith(this.#props.node, {
|
|
24
24
|
cascade: true,
|
|
25
25
|
}),
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
toOperationNode() {
|
|
29
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
29
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
30
30
|
}
|
|
31
31
|
compile() {
|
|
32
32
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -16,5 +16,5 @@ export declare class DropTableBuilder implements OperationNodeSource, Compilable
|
|
|
16
16
|
export interface DropTableBuilderProps {
|
|
17
17
|
readonly queryId: QueryId;
|
|
18
18
|
readonly executor: QueryExecutor;
|
|
19
|
-
readonly
|
|
19
|
+
readonly node: DropTableNode;
|
|
20
20
|
}
|
|
@@ -12,7 +12,7 @@ class DropTableBuilder {
|
|
|
12
12
|
ifExists() {
|
|
13
13
|
return new DropTableBuilder({
|
|
14
14
|
...this.#props,
|
|
15
|
-
|
|
15
|
+
node: drop_table_node_js_1.DropTableNode.cloneWith(this.#props.node, {
|
|
16
16
|
ifExists: true,
|
|
17
17
|
}),
|
|
18
18
|
});
|
|
@@ -20,13 +20,13 @@ class DropTableBuilder {
|
|
|
20
20
|
cascade() {
|
|
21
21
|
return new DropTableBuilder({
|
|
22
22
|
...this.#props,
|
|
23
|
-
|
|
23
|
+
node: drop_table_node_js_1.DropTableNode.cloneWith(this.#props.node, {
|
|
24
24
|
cascade: true,
|
|
25
25
|
}),
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
toOperationNode() {
|
|
29
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
29
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
30
30
|
}
|
|
31
31
|
compile() {
|
|
32
32
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -15,5 +15,5 @@ export declare class DropTypeBuilder implements OperationNodeSource, Compilable
|
|
|
15
15
|
export interface DropTypeBuilderProps {
|
|
16
16
|
readonly queryId: QueryId;
|
|
17
17
|
readonly executor: QueryExecutor;
|
|
18
|
-
readonly
|
|
18
|
+
readonly node: DropTypeNode;
|
|
19
19
|
}
|
|
@@ -12,13 +12,13 @@ class DropTypeBuilder {
|
|
|
12
12
|
ifExists() {
|
|
13
13
|
return new DropTypeBuilder({
|
|
14
14
|
...this.#props,
|
|
15
|
-
|
|
15
|
+
node: drop_type_node_js_1.DropTypeNode.cloneWith(this.#props.node, {
|
|
16
16
|
ifExists: true,
|
|
17
17
|
}),
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
toOperationNode() {
|
|
21
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
21
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
22
22
|
}
|
|
23
23
|
compile() {
|
|
24
24
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -17,5 +17,5 @@ export declare class DropViewBuilder implements OperationNodeSource, Compilable
|
|
|
17
17
|
export interface DropViewBuilderProps {
|
|
18
18
|
readonly queryId: QueryId;
|
|
19
19
|
readonly executor: QueryExecutor;
|
|
20
|
-
readonly
|
|
20
|
+
readonly node: DropViewNode;
|
|
21
21
|
}
|
|
@@ -12,7 +12,7 @@ class DropViewBuilder {
|
|
|
12
12
|
materialized() {
|
|
13
13
|
return new DropViewBuilder({
|
|
14
14
|
...this.#props,
|
|
15
|
-
|
|
15
|
+
node: drop_view_node_js_1.DropViewNode.cloneWith(this.#props.node, {
|
|
16
16
|
materialized: true,
|
|
17
17
|
}),
|
|
18
18
|
});
|
|
@@ -20,7 +20,7 @@ class DropViewBuilder {
|
|
|
20
20
|
ifExists() {
|
|
21
21
|
return new DropViewBuilder({
|
|
22
22
|
...this.#props,
|
|
23
|
-
|
|
23
|
+
node: drop_view_node_js_1.DropViewNode.cloneWith(this.#props.node, {
|
|
24
24
|
ifExists: true,
|
|
25
25
|
}),
|
|
26
26
|
});
|
|
@@ -28,13 +28,13 @@ class DropViewBuilder {
|
|
|
28
28
|
cascade() {
|
|
29
29
|
return new DropViewBuilder({
|
|
30
30
|
...this.#props,
|
|
31
|
-
|
|
31
|
+
node: drop_view_node_js_1.DropViewNode.cloneWith(this.#props.node, {
|
|
32
32
|
cascade: true,
|
|
33
33
|
}),
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
toOperationNode() {
|
|
37
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
37
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
38
38
|
}
|
|
39
39
|
compile() {
|
|
40
40
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -90,7 +90,7 @@ class SchemaModule {
|
|
|
90
90
|
return new create_table_builder_js_1.CreateTableBuilder({
|
|
91
91
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
92
92
|
executor: this.#executor,
|
|
93
|
-
|
|
93
|
+
node: create_table_node_js_1.CreateTableNode.create((0, table_parser_js_1.parseTable)(table)),
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
@@ -108,7 +108,7 @@ class SchemaModule {
|
|
|
108
108
|
return new drop_table_builder_js_1.DropTableBuilder({
|
|
109
109
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
110
110
|
executor: this.#executor,
|
|
111
|
-
|
|
111
|
+
node: drop_table_node_js_1.DropTableNode.create((0, table_parser_js_1.parseTable)(table)),
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
@@ -128,7 +128,7 @@ class SchemaModule {
|
|
|
128
128
|
return new create_index_builder_js_1.CreateIndexBuilder({
|
|
129
129
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
130
130
|
executor: this.#executor,
|
|
131
|
-
|
|
131
|
+
node: create_index_node_js_1.CreateIndexNode.create(indexName),
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
@@ -146,7 +146,7 @@ class SchemaModule {
|
|
|
146
146
|
return new drop_index_builder_js_1.DropIndexBuilder({
|
|
147
147
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
148
148
|
executor: this.#executor,
|
|
149
|
-
|
|
149
|
+
node: drop_index_node_js_1.DropIndexNode.create(indexName),
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
@@ -164,7 +164,7 @@ class SchemaModule {
|
|
|
164
164
|
return new create_schema_builder_js_1.CreateSchemaBuilder({
|
|
165
165
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
166
166
|
executor: this.#executor,
|
|
167
|
-
|
|
167
|
+
node: create_schema_node_js_1.CreateSchemaNode.create(schema),
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
@@ -182,7 +182,7 @@ class SchemaModule {
|
|
|
182
182
|
return new drop_schema_builder_js_1.DropSchemaBuilder({
|
|
183
183
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
184
184
|
executor: this.#executor,
|
|
185
|
-
|
|
185
|
+
node: drop_schema_node_js_1.DropSchemaNode.create(schema),
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
@@ -222,7 +222,7 @@ class SchemaModule {
|
|
|
222
222
|
return new create_view_builder_js_1.CreateViewBuilder({
|
|
223
223
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
224
224
|
executor: this.#executor,
|
|
225
|
-
|
|
225
|
+
node: create_view_node_js_1.CreateViewNode.create(viewName),
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
@@ -241,7 +241,7 @@ class SchemaModule {
|
|
|
241
241
|
return new drop_view_builder_js_1.DropViewBuilder({
|
|
242
242
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
243
243
|
executor: this.#executor,
|
|
244
|
-
|
|
244
|
+
node: drop_view_node_js_1.DropViewNode.create(viewName),
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
247
|
/**
|
|
@@ -262,7 +262,7 @@ class SchemaModule {
|
|
|
262
262
|
return new create_type_builder_js_1.CreateTypeBuilder({
|
|
263
263
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
264
264
|
executor: this.#executor,
|
|
265
|
-
|
|
265
|
+
node: create_type_node_js_1.CreateTypeNode.create((0, identifier_parser_js_1.parseSchemableIdentifier)(typeName)),
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
@@ -283,7 +283,7 @@ class SchemaModule {
|
|
|
283
283
|
return new drop_type_builder_js_1.DropTypeBuilder({
|
|
284
284
|
queryId: (0, query_id_js_1.createQueryId)(),
|
|
285
285
|
executor: this.#executor,
|
|
286
|
-
|
|
286
|
+
node: drop_type_node_js_1.DropTypeNode.create((0, identifier_parser_js_1.parseSchemableIdentifier)(typeName)),
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
289
|
/**
|
|
@@ -57,8 +57,8 @@ export declare class AlterTableBuilder implements ColumnAlteringInterface {
|
|
|
57
57
|
}
|
|
58
58
|
export interface AlterTableBuilderProps {
|
|
59
59
|
readonly queryId: QueryId;
|
|
60
|
-
readonly node: AlterTableNode;
|
|
61
60
|
readonly executor: QueryExecutor;
|
|
61
|
+
readonly node: AlterTableNode;
|
|
62
62
|
}
|
|
63
63
|
export declare class AlterTableExecutor implements OperationNodeSource, Compilable {
|
|
64
64
|
#private;
|
|
@@ -147,7 +147,7 @@ export class AlterTableExecutor {
|
|
|
147
147
|
export class AlterTableColumnAlteringBuilder {
|
|
148
148
|
#props;
|
|
149
149
|
constructor(props) {
|
|
150
|
-
this.#props = props;
|
|
150
|
+
this.#props = freeze(props);
|
|
151
151
|
}
|
|
152
152
|
alterColumn(column, alteration) {
|
|
153
153
|
const builder = alteration(new AlterColumnBuilder(AlterColumnNode.create(column)));
|
|
@@ -183,10 +183,10 @@ export class AlterTableColumnAlteringBuilder {
|
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
toOperationNode() {
|
|
186
|
-
return this.#props.node;
|
|
186
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
187
187
|
}
|
|
188
188
|
compile() {
|
|
189
|
-
return this.#props.executor.compileQuery(this
|
|
189
|
+
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
190
190
|
}
|
|
191
191
|
async execute() {
|
|
192
192
|
await this.#props.executor.executeQuery(this.compile(), this.#props.queryId);
|
|
@@ -56,5 +56,5 @@ export declare class CreateIndexBuilder implements OperationNodeSource, Compilab
|
|
|
56
56
|
export interface CreateIndexBuilderProps {
|
|
57
57
|
readonly queryId: QueryId;
|
|
58
58
|
readonly executor: QueryExecutor;
|
|
59
|
-
readonly
|
|
59
|
+
readonly node: CreateIndexNode;
|
|
60
60
|
}
|
|
@@ -17,7 +17,7 @@ export class CreateIndexBuilder {
|
|
|
17
17
|
unique() {
|
|
18
18
|
return new CreateIndexBuilder({
|
|
19
19
|
...this.#props,
|
|
20
|
-
|
|
20
|
+
node: CreateIndexNode.cloneWith(this.#props.node, {
|
|
21
21
|
unique: true,
|
|
22
22
|
}),
|
|
23
23
|
});
|
|
@@ -28,7 +28,7 @@ export class CreateIndexBuilder {
|
|
|
28
28
|
on(table) {
|
|
29
29
|
return new CreateIndexBuilder({
|
|
30
30
|
...this.#props,
|
|
31
|
-
|
|
31
|
+
node: CreateIndexNode.cloneWith(this.#props.node, {
|
|
32
32
|
table: parseTable(table),
|
|
33
33
|
}),
|
|
34
34
|
});
|
|
@@ -41,7 +41,7 @@ export class CreateIndexBuilder {
|
|
|
41
41
|
column(column) {
|
|
42
42
|
return new CreateIndexBuilder({
|
|
43
43
|
...this.#props,
|
|
44
|
-
|
|
44
|
+
node: CreateIndexNode.cloneWith(this.#props.node, {
|
|
45
45
|
expression: parseColumnName(column),
|
|
46
46
|
}),
|
|
47
47
|
});
|
|
@@ -54,7 +54,7 @@ export class CreateIndexBuilder {
|
|
|
54
54
|
columns(columns) {
|
|
55
55
|
return new CreateIndexBuilder({
|
|
56
56
|
...this.#props,
|
|
57
|
-
|
|
57
|
+
node: CreateIndexNode.cloneWith(this.#props.node, {
|
|
58
58
|
expression: ListNode.create(columns.map(parseColumnName)),
|
|
59
59
|
}),
|
|
60
60
|
});
|
|
@@ -77,7 +77,7 @@ export class CreateIndexBuilder {
|
|
|
77
77
|
expression(expression) {
|
|
78
78
|
return new CreateIndexBuilder({
|
|
79
79
|
...this.#props,
|
|
80
|
-
|
|
80
|
+
node: CreateIndexNode.cloneWith(this.#props.node, {
|
|
81
81
|
expression: expression.toOperationNode(),
|
|
82
82
|
}),
|
|
83
83
|
});
|
|
@@ -85,13 +85,13 @@ export class CreateIndexBuilder {
|
|
|
85
85
|
using(indexType) {
|
|
86
86
|
return new CreateIndexBuilder({
|
|
87
87
|
...this.#props,
|
|
88
|
-
|
|
88
|
+
node: CreateIndexNode.cloneWith(this.#props.node, {
|
|
89
89
|
using: RawNode.createWithSql(indexType),
|
|
90
90
|
}),
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
toOperationNode() {
|
|
94
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
94
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
95
95
|
}
|
|
96
96
|
compile() {
|
|
97
97
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -15,5 +15,5 @@ export declare class CreateSchemaBuilder implements OperationNodeSource, Compila
|
|
|
15
15
|
export interface CreateSchemaBuilderProps {
|
|
16
16
|
readonly queryId: QueryId;
|
|
17
17
|
readonly executor: QueryExecutor;
|
|
18
|
-
readonly
|
|
18
|
+
readonly node: CreateSchemaNode;
|
|
19
19
|
}
|
|
@@ -10,11 +10,11 @@ export class CreateSchemaBuilder {
|
|
|
10
10
|
ifNotExists() {
|
|
11
11
|
return new CreateSchemaBuilder({
|
|
12
12
|
...this.#props,
|
|
13
|
-
|
|
13
|
+
node: CreateSchemaNode.cloneWith(this.#props.node, { ifNotExists: true }),
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
toOperationNode() {
|
|
17
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
17
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
18
18
|
}
|
|
19
19
|
compile() {
|
|
20
20
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -243,7 +243,7 @@ export declare class CreateTableBuilder<TB extends string, C extends string = ne
|
|
|
243
243
|
export interface CreateTableBuilderProps {
|
|
244
244
|
readonly queryId: QueryId;
|
|
245
245
|
readonly executor: QueryExecutor;
|
|
246
|
-
readonly
|
|
246
|
+
readonly node: CreateTableNode;
|
|
247
247
|
}
|
|
248
248
|
export declare type ColumnBuilderCallback = (builder: ColumnDefinitionBuilder) => ColumnDefinitionBuilder;
|
|
249
249
|
export declare type ForeignKeyConstraintBuilderCallback = (builder: ForeignKeyConstraintBuilder) => ForeignKeyConstraintBuilder;
|
|
@@ -29,7 +29,7 @@ export class CreateTableBuilder {
|
|
|
29
29
|
temporary() {
|
|
30
30
|
return new CreateTableBuilder({
|
|
31
31
|
...this.#props,
|
|
32
|
-
|
|
32
|
+
node: CreateTableNode.cloneWith(this.#props.node, {
|
|
33
33
|
temporary: true,
|
|
34
34
|
}),
|
|
35
35
|
});
|
|
@@ -43,7 +43,7 @@ export class CreateTableBuilder {
|
|
|
43
43
|
onCommit(onCommit) {
|
|
44
44
|
return new CreateTableBuilder({
|
|
45
45
|
...this.#props,
|
|
46
|
-
|
|
46
|
+
node: CreateTableNode.cloneWith(this.#props.node, {
|
|
47
47
|
onCommit: parseOnCommitAction(onCommit),
|
|
48
48
|
}),
|
|
49
49
|
});
|
|
@@ -56,7 +56,7 @@ export class CreateTableBuilder {
|
|
|
56
56
|
ifNotExists() {
|
|
57
57
|
return new CreateTableBuilder({
|
|
58
58
|
...this.#props,
|
|
59
|
-
|
|
59
|
+
node: CreateTableNode.cloneWith(this.#props.node, {
|
|
60
60
|
ifNotExists: true,
|
|
61
61
|
}),
|
|
62
62
|
});
|
|
@@ -109,7 +109,7 @@ export class CreateTableBuilder {
|
|
|
109
109
|
const columnBuilder = build(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(columnName, parseDataTypeExpression(dataType))));
|
|
110
110
|
return new CreateTableBuilder({
|
|
111
111
|
...this.#props,
|
|
112
|
-
|
|
112
|
+
node: CreateTableNode.cloneWithColumn(this.#props.node, columnBuilder.toOperationNode()),
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
@@ -127,7 +127,7 @@ export class CreateTableBuilder {
|
|
|
127
127
|
addPrimaryKeyConstraint(constraintName, columns) {
|
|
128
128
|
return new CreateTableBuilder({
|
|
129
129
|
...this.#props,
|
|
130
|
-
|
|
130
|
+
node: CreateTableNode.cloneWithConstraint(this.#props.node, PrimaryConstraintNode.create(columns, constraintName)),
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
@@ -145,7 +145,7 @@ export class CreateTableBuilder {
|
|
|
145
145
|
addUniqueConstraint(constraintName, columns) {
|
|
146
146
|
return new CreateTableBuilder({
|
|
147
147
|
...this.#props,
|
|
148
|
-
|
|
148
|
+
node: CreateTableNode.cloneWithConstraint(this.#props.node, UniqueConstraintNode.create(columns, constraintName)),
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
@@ -165,7 +165,7 @@ export class CreateTableBuilder {
|
|
|
165
165
|
addCheckConstraint(constraintName, checkExpression) {
|
|
166
166
|
return new CreateTableBuilder({
|
|
167
167
|
...this.#props,
|
|
168
|
-
|
|
168
|
+
node: CreateTableNode.cloneWithConstraint(this.#props.node, CheckConstraintNode.create(checkExpression.toOperationNode(), constraintName)),
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
@@ -201,7 +201,7 @@ export class CreateTableBuilder {
|
|
|
201
201
|
const builder = build(new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.create(columns.map(ColumnNode.create), parseTable(targetTable), targetColumns.map(ColumnNode.create), constraintName)));
|
|
202
202
|
return new CreateTableBuilder({
|
|
203
203
|
...this.#props,
|
|
204
|
-
|
|
204
|
+
node: CreateTableNode.cloneWithConstraint(this.#props.node, builder.toOperationNode()),
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
/**
|
|
@@ -233,7 +233,7 @@ export class CreateTableBuilder {
|
|
|
233
233
|
modifyFront(modifier) {
|
|
234
234
|
return new CreateTableBuilder({
|
|
235
235
|
...this.#props,
|
|
236
|
-
|
|
236
|
+
node: CreateTableNode.cloneWithFrontModifier(this.#props.node, modifier.toOperationNode()),
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
/**
|
|
@@ -265,7 +265,7 @@ export class CreateTableBuilder {
|
|
|
265
265
|
modifyEnd(modifier) {
|
|
266
266
|
return new CreateTableBuilder({
|
|
267
267
|
...this.#props,
|
|
268
|
-
|
|
268
|
+
node: CreateTableNode.cloneWithEndModifier(this.#props.node, modifier.toOperationNode()),
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
@@ -304,7 +304,7 @@ export class CreateTableBuilder {
|
|
|
304
304
|
return func(this);
|
|
305
305
|
}
|
|
306
306
|
toOperationNode() {
|
|
307
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
307
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
308
308
|
}
|
|
309
309
|
compile() {
|
|
310
310
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -24,5 +24,5 @@ export declare class CreateTypeBuilder implements OperationNodeSource, Compilabl
|
|
|
24
24
|
export interface CreateTypeBuilderProps {
|
|
25
25
|
readonly queryId: QueryId;
|
|
26
26
|
readonly executor: QueryExecutor;
|
|
27
|
-
readonly
|
|
27
|
+
readonly node: CreateTypeNode;
|
|
28
28
|
}
|
|
@@ -8,7 +8,7 @@ export class CreateTypeBuilder {
|
|
|
8
8
|
this.#props = freeze(props);
|
|
9
9
|
}
|
|
10
10
|
toOperationNode() {
|
|
11
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
11
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Creates an anum type.
|
|
@@ -22,7 +22,7 @@ export class CreateTypeBuilder {
|
|
|
22
22
|
asEnum(values) {
|
|
23
23
|
return new CreateTypeBuilder({
|
|
24
24
|
...this.#props,
|
|
25
|
-
|
|
25
|
+
node: CreateTypeNode.cloneWithEnum(this.#props.node, values),
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
compile() {
|
|
@@ -39,5 +39,5 @@ export declare class CreateViewBuilder implements OperationNodeSource, Compilabl
|
|
|
39
39
|
export interface CreateViewBuilderProps {
|
|
40
40
|
readonly queryId: QueryId;
|
|
41
41
|
readonly executor: QueryExecutor;
|
|
42
|
-
readonly
|
|
42
|
+
readonly node: CreateViewNode;
|
|
43
43
|
}
|
|
@@ -17,7 +17,7 @@ export class CreateViewBuilder {
|
|
|
17
17
|
temporary() {
|
|
18
18
|
return new CreateViewBuilder({
|
|
19
19
|
...this.#props,
|
|
20
|
-
|
|
20
|
+
node: CreateViewNode.cloneWith(this.#props.node, {
|
|
21
21
|
temporary: true,
|
|
22
22
|
}),
|
|
23
23
|
});
|
|
@@ -25,7 +25,7 @@ export class CreateViewBuilder {
|
|
|
25
25
|
materialized() {
|
|
26
26
|
return new CreateViewBuilder({
|
|
27
27
|
...this.#props,
|
|
28
|
-
|
|
28
|
+
node: CreateViewNode.cloneWith(this.#props.node, {
|
|
29
29
|
materialized: true,
|
|
30
30
|
}),
|
|
31
31
|
});
|
|
@@ -36,7 +36,7 @@ export class CreateViewBuilder {
|
|
|
36
36
|
ifNotExists() {
|
|
37
37
|
return new CreateViewBuilder({
|
|
38
38
|
...this.#props,
|
|
39
|
-
|
|
39
|
+
node: CreateViewNode.cloneWith(this.#props.node, {
|
|
40
40
|
ifNotExists: true,
|
|
41
41
|
}),
|
|
42
42
|
});
|
|
@@ -44,7 +44,7 @@ export class CreateViewBuilder {
|
|
|
44
44
|
orReplace() {
|
|
45
45
|
return new CreateViewBuilder({
|
|
46
46
|
...this.#props,
|
|
47
|
-
|
|
47
|
+
node: CreateViewNode.cloneWith(this.#props.node, {
|
|
48
48
|
orReplace: true,
|
|
49
49
|
}),
|
|
50
50
|
});
|
|
@@ -52,7 +52,7 @@ export class CreateViewBuilder {
|
|
|
52
52
|
columns(columns) {
|
|
53
53
|
return new CreateViewBuilder({
|
|
54
54
|
...this.#props,
|
|
55
|
-
|
|
55
|
+
node: CreateViewNode.cloneWith(this.#props.node, {
|
|
56
56
|
columns: columns.map(parseColumnName),
|
|
57
57
|
}),
|
|
58
58
|
});
|
|
@@ -72,13 +72,13 @@ export class CreateViewBuilder {
|
|
|
72
72
|
.toOperationNode();
|
|
73
73
|
return new CreateViewBuilder({
|
|
74
74
|
...this.#props,
|
|
75
|
-
|
|
75
|
+
node: CreateViewNode.cloneWith(this.#props.node, {
|
|
76
76
|
as: queryNode,
|
|
77
77
|
}),
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
toOperationNode() {
|
|
81
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
81
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
82
82
|
}
|
|
83
83
|
compile() {
|
|
84
84
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -21,5 +21,5 @@ export declare class DropIndexBuilder implements OperationNodeSource, Compilable
|
|
|
21
21
|
export interface DropIndexBuilderProps {
|
|
22
22
|
readonly queryId: QueryId;
|
|
23
23
|
readonly executor: QueryExecutor;
|
|
24
|
-
readonly
|
|
24
|
+
readonly node: DropIndexNode;
|
|
25
25
|
}
|
|
@@ -15,7 +15,7 @@ export class DropIndexBuilder {
|
|
|
15
15
|
on(table) {
|
|
16
16
|
return new DropIndexBuilder({
|
|
17
17
|
...this.#props,
|
|
18
|
-
|
|
18
|
+
node: DropIndexNode.cloneWith(this.#props.node, {
|
|
19
19
|
table: parseTable(table),
|
|
20
20
|
}),
|
|
21
21
|
});
|
|
@@ -23,7 +23,7 @@ export class DropIndexBuilder {
|
|
|
23
23
|
ifExists() {
|
|
24
24
|
return new DropIndexBuilder({
|
|
25
25
|
...this.#props,
|
|
26
|
-
|
|
26
|
+
node: DropIndexNode.cloneWith(this.#props.node, {
|
|
27
27
|
ifExists: true,
|
|
28
28
|
}),
|
|
29
29
|
});
|
|
@@ -31,13 +31,13 @@ export class DropIndexBuilder {
|
|
|
31
31
|
cascade() {
|
|
32
32
|
return new DropIndexBuilder({
|
|
33
33
|
...this.#props,
|
|
34
|
-
|
|
34
|
+
node: DropIndexNode.cloneWith(this.#props.node, {
|
|
35
35
|
cascade: true,
|
|
36
36
|
}),
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
toOperationNode() {
|
|
40
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
40
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
41
41
|
}
|
|
42
42
|
compile() {
|
|
43
43
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -16,5 +16,5 @@ export declare class DropSchemaBuilder implements OperationNodeSource, Compilabl
|
|
|
16
16
|
export interface DropSchemaBuilderProps {
|
|
17
17
|
readonly queryId: QueryId;
|
|
18
18
|
readonly executor: QueryExecutor;
|
|
19
|
-
readonly
|
|
19
|
+
readonly node: DropSchemaNode;
|
|
20
20
|
}
|
|
@@ -10,7 +10,7 @@ export class DropSchemaBuilder {
|
|
|
10
10
|
ifExists() {
|
|
11
11
|
return new DropSchemaBuilder({
|
|
12
12
|
...this.#props,
|
|
13
|
-
|
|
13
|
+
node: DropSchemaNode.cloneWith(this.#props.node, {
|
|
14
14
|
ifExists: true,
|
|
15
15
|
}),
|
|
16
16
|
});
|
|
@@ -18,13 +18,13 @@ export class DropSchemaBuilder {
|
|
|
18
18
|
cascade() {
|
|
19
19
|
return new DropSchemaBuilder({
|
|
20
20
|
...this.#props,
|
|
21
|
-
|
|
21
|
+
node: DropSchemaNode.cloneWith(this.#props.node, {
|
|
22
22
|
cascade: true,
|
|
23
23
|
}),
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
toOperationNode() {
|
|
27
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
27
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
28
28
|
}
|
|
29
29
|
compile() {
|
|
30
30
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -16,5 +16,5 @@ export declare class DropTableBuilder implements OperationNodeSource, Compilable
|
|
|
16
16
|
export interface DropTableBuilderProps {
|
|
17
17
|
readonly queryId: QueryId;
|
|
18
18
|
readonly executor: QueryExecutor;
|
|
19
|
-
readonly
|
|
19
|
+
readonly node: DropTableNode;
|
|
20
20
|
}
|
|
@@ -10,7 +10,7 @@ export class DropTableBuilder {
|
|
|
10
10
|
ifExists() {
|
|
11
11
|
return new DropTableBuilder({
|
|
12
12
|
...this.#props,
|
|
13
|
-
|
|
13
|
+
node: DropTableNode.cloneWith(this.#props.node, {
|
|
14
14
|
ifExists: true,
|
|
15
15
|
}),
|
|
16
16
|
});
|
|
@@ -18,13 +18,13 @@ export class DropTableBuilder {
|
|
|
18
18
|
cascade() {
|
|
19
19
|
return new DropTableBuilder({
|
|
20
20
|
...this.#props,
|
|
21
|
-
|
|
21
|
+
node: DropTableNode.cloneWith(this.#props.node, {
|
|
22
22
|
cascade: true,
|
|
23
23
|
}),
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
toOperationNode() {
|
|
27
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
27
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
28
28
|
}
|
|
29
29
|
compile() {
|
|
30
30
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -15,5 +15,5 @@ export declare class DropTypeBuilder implements OperationNodeSource, Compilable
|
|
|
15
15
|
export interface DropTypeBuilderProps {
|
|
16
16
|
readonly queryId: QueryId;
|
|
17
17
|
readonly executor: QueryExecutor;
|
|
18
|
-
readonly
|
|
18
|
+
readonly node: DropTypeNode;
|
|
19
19
|
}
|
|
@@ -10,13 +10,13 @@ export class DropTypeBuilder {
|
|
|
10
10
|
ifExists() {
|
|
11
11
|
return new DropTypeBuilder({
|
|
12
12
|
...this.#props,
|
|
13
|
-
|
|
13
|
+
node: DropTypeNode.cloneWith(this.#props.node, {
|
|
14
14
|
ifExists: true,
|
|
15
15
|
}),
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
toOperationNode() {
|
|
19
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
19
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
20
20
|
}
|
|
21
21
|
compile() {
|
|
22
22
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -17,5 +17,5 @@ export declare class DropViewBuilder implements OperationNodeSource, Compilable
|
|
|
17
17
|
export interface DropViewBuilderProps {
|
|
18
18
|
readonly queryId: QueryId;
|
|
19
19
|
readonly executor: QueryExecutor;
|
|
20
|
-
readonly
|
|
20
|
+
readonly node: DropViewNode;
|
|
21
21
|
}
|
|
@@ -10,7 +10,7 @@ export class DropViewBuilder {
|
|
|
10
10
|
materialized() {
|
|
11
11
|
return new DropViewBuilder({
|
|
12
12
|
...this.#props,
|
|
13
|
-
|
|
13
|
+
node: DropViewNode.cloneWith(this.#props.node, {
|
|
14
14
|
materialized: true,
|
|
15
15
|
}),
|
|
16
16
|
});
|
|
@@ -18,7 +18,7 @@ export class DropViewBuilder {
|
|
|
18
18
|
ifExists() {
|
|
19
19
|
return new DropViewBuilder({
|
|
20
20
|
...this.#props,
|
|
21
|
-
|
|
21
|
+
node: DropViewNode.cloneWith(this.#props.node, {
|
|
22
22
|
ifExists: true,
|
|
23
23
|
}),
|
|
24
24
|
});
|
|
@@ -26,13 +26,13 @@ export class DropViewBuilder {
|
|
|
26
26
|
cascade() {
|
|
27
27
|
return new DropViewBuilder({
|
|
28
28
|
...this.#props,
|
|
29
|
-
|
|
29
|
+
node: DropViewNode.cloneWith(this.#props.node, {
|
|
30
30
|
cascade: true,
|
|
31
31
|
}),
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
toOperationNode() {
|
|
35
|
-
return this.#props.executor.transformQuery(this.#props.
|
|
35
|
+
return this.#props.executor.transformQuery(this.#props.node, this.#props.queryId);
|
|
36
36
|
}
|
|
37
37
|
compile() {
|
|
38
38
|
return this.#props.executor.compileQuery(this.toOperationNode(), this.#props.queryId);
|
|
@@ -88,7 +88,7 @@ export class SchemaModule {
|
|
|
88
88
|
return new CreateTableBuilder({
|
|
89
89
|
queryId: createQueryId(),
|
|
90
90
|
executor: this.#executor,
|
|
91
|
-
|
|
91
|
+
node: CreateTableNode.create(parseTable(table)),
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
@@ -106,7 +106,7 @@ export class SchemaModule {
|
|
|
106
106
|
return new DropTableBuilder({
|
|
107
107
|
queryId: createQueryId(),
|
|
108
108
|
executor: this.#executor,
|
|
109
|
-
|
|
109
|
+
node: DropTableNode.create(parseTable(table)),
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
@@ -126,7 +126,7 @@ export class SchemaModule {
|
|
|
126
126
|
return new CreateIndexBuilder({
|
|
127
127
|
queryId: createQueryId(),
|
|
128
128
|
executor: this.#executor,
|
|
129
|
-
|
|
129
|
+
node: CreateIndexNode.create(indexName),
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
@@ -144,7 +144,7 @@ export class SchemaModule {
|
|
|
144
144
|
return new DropIndexBuilder({
|
|
145
145
|
queryId: createQueryId(),
|
|
146
146
|
executor: this.#executor,
|
|
147
|
-
|
|
147
|
+
node: DropIndexNode.create(indexName),
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
@@ -162,7 +162,7 @@ export class SchemaModule {
|
|
|
162
162
|
return new CreateSchemaBuilder({
|
|
163
163
|
queryId: createQueryId(),
|
|
164
164
|
executor: this.#executor,
|
|
165
|
-
|
|
165
|
+
node: CreateSchemaNode.create(schema),
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
@@ -180,7 +180,7 @@ export class SchemaModule {
|
|
|
180
180
|
return new DropSchemaBuilder({
|
|
181
181
|
queryId: createQueryId(),
|
|
182
182
|
executor: this.#executor,
|
|
183
|
-
|
|
183
|
+
node: DropSchemaNode.create(schema),
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
@@ -220,7 +220,7 @@ export class SchemaModule {
|
|
|
220
220
|
return new CreateViewBuilder({
|
|
221
221
|
queryId: createQueryId(),
|
|
222
222
|
executor: this.#executor,
|
|
223
|
-
|
|
223
|
+
node: CreateViewNode.create(viewName),
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
@@ -239,7 +239,7 @@ export class SchemaModule {
|
|
|
239
239
|
return new DropViewBuilder({
|
|
240
240
|
queryId: createQueryId(),
|
|
241
241
|
executor: this.#executor,
|
|
242
|
-
|
|
242
|
+
node: DropViewNode.create(viewName),
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
/**
|
|
@@ -260,7 +260,7 @@ export class SchemaModule {
|
|
|
260
260
|
return new CreateTypeBuilder({
|
|
261
261
|
queryId: createQueryId(),
|
|
262
262
|
executor: this.#executor,
|
|
263
|
-
|
|
263
|
+
node: CreateTypeNode.create(parseSchemableIdentifier(typeName)),
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
@@ -281,7 +281,7 @@ export class SchemaModule {
|
|
|
281
281
|
return new DropTypeBuilder({
|
|
282
282
|
queryId: createQueryId(),
|
|
283
283
|
executor: this.#executor,
|
|
284
|
-
|
|
284
|
+
node: DropTypeNode.create(parseSchemableIdentifier(typeName)),
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
287
|
/**
|