kysely 0.12.0 → 0.14.0
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/README.md +34 -10
- package/dist/cjs/{introspection → dialect}/database-introspector.d.ts +0 -0
- package/dist/cjs/{introspection → dialect}/database-introspector.js +0 -0
- package/dist/cjs/dialect/dialect-adapter-base.d.ts +36 -0
- package/dist/cjs/dialect/dialect.d.ts +1 -1
- package/dist/cjs/dialect/mysql/mysql-adapter.d.ts +38 -2
- package/dist/cjs/dialect/mysql/mysql-adapter.js +2 -1
- package/dist/cjs/dialect/mysql/mysql-dialect.d.ts +17 -1
- package/dist/cjs/dialect/mysql/mysql-driver.d.ts +29 -0
- package/dist/cjs/dialect/mysql/mysql-introspector.d.ts +4 -1
- package/dist/cjs/dialect/postgres/postgres-adapter.d.ts +38 -2
- package/dist/cjs/dialect/postgres/postgres-adapter.js +2 -1
- package/dist/cjs/dialect/postgres/postgres-dialect.d.ts +17 -1
- package/dist/cjs/dialect/postgres/postgres-driver.d.ts +29 -0
- package/dist/cjs/dialect/postgres/postgres-introspector.d.ts +4 -1
- package/dist/cjs/dialect/sqlite/sqlite-adapter.d.ts +38 -2
- package/dist/cjs/dialect/sqlite/sqlite-dialect.d.ts +17 -1
- package/dist/cjs/dialect/sqlite/sqlite-driver.d.ts +29 -0
- package/dist/cjs/dialect/sqlite/sqlite-introspector.d.ts +4 -1
- package/dist/cjs/driver/default-connection-provider.d.ts +4 -0
- package/dist/cjs/driver/runtime-driver.d.ts +29 -0
- package/dist/cjs/driver/single-connection-provider.d.ts +4 -0
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/kysely.d.ts +152 -1
- package/dist/cjs/kysely.js +37 -0
- package/dist/cjs/migration/migration.d.ts +154 -11
- package/dist/cjs/migration/migration.js +256 -135
- package/dist/cjs/operation-node/check-constraint-node.d.ts +1 -1
- package/dist/cjs/operation-node/check-constraint-node.js +2 -3
- package/dist/cjs/operation-node/column-definition-node.d.ts +8 -7
- package/dist/cjs/operation-node/column-definition-node.js +0 -4
- package/dist/cjs/operation-node/common-table-expression-name-node.d.ts +15 -0
- package/dist/cjs/operation-node/common-table-expression-name-node.js +23 -0
- package/dist/cjs/operation-node/common-table-expression-node.d.ts +3 -3
- package/dist/cjs/operation-node/data-type-node.d.ts +1 -1
- package/dist/cjs/operation-node/generated-node.d.ts +20 -0
- package/dist/cjs/operation-node/generated-node.js +31 -0
- package/dist/cjs/operation-node/on-conflict-node.d.ts +13 -2
- package/dist/cjs/operation-node/on-conflict-node.js +39 -1
- package/dist/cjs/operation-node/operation-node-transformer.d.ts +4 -2
- package/dist/cjs/operation-node/operation-node-transformer.js +22 -6
- package/dist/cjs/operation-node/operation-node-visitor.d.ts +4 -2
- package/dist/cjs/operation-node/operation-node-visitor.js +2 -1
- package/dist/cjs/operation-node/operation-node.d.ts +1 -1
- package/dist/cjs/operation-node/with-node.d.ts +3 -1
- package/dist/cjs/operation-node/with-node.js +2 -1
- package/dist/cjs/package.json +1 -3
- package/dist/cjs/parser/parse-context.d.ts +14 -0
- package/dist/cjs/parser/with-parser.d.ts +32 -5
- package/dist/cjs/parser/with-parser.js +13 -2
- package/dist/cjs/plugin/camel-case/camel-case-plugin.d.ts +36 -2
- package/dist/cjs/plugin/immediate-value.ts/immediate-value-plugin.d.ts +34 -0
- package/dist/cjs/plugin/with-schema/with-schema-plugin.d.ts +34 -0
- package/dist/cjs/plugin/with-schema/with-schema-transformer.js +8 -0
- package/dist/cjs/query-builder/delete-query-builder.d.ts +545 -0
- package/dist/cjs/query-builder/insert-query-builder.d.ts +142 -76
- package/dist/cjs/query-builder/insert-query-builder.js +150 -15
- package/dist/cjs/query-builder/join-interface.d.ts +3 -6
- package/dist/cjs/query-builder/on-conflict-builder.d.ts +684 -0
- package/dist/cjs/query-builder/on-conflict-builder.js +323 -0
- package/dist/cjs/query-builder/returning-interface.d.ts +1 -1
- package/dist/cjs/query-builder/select-query-builder.d.ts +513 -2
- package/dist/cjs/query-builder/select-query-builder.js +2 -2
- package/dist/cjs/query-builder/update-query-builder.d.ts +547 -2
- package/dist/cjs/query-builder/update-query-builder.js +2 -2
- package/dist/cjs/query-builder/where-interface.d.ts +7 -10
- package/dist/cjs/query-compiler/default-query-compiler.d.ts +4 -2
- package/dist/cjs/query-compiler/default-query-compiler.js +48 -8
- package/dist/cjs/query-creator.d.ts +27 -3
- package/dist/cjs/query-creator.js +33 -1
- package/dist/cjs/query-executor/default-query-executor.d.ts +19 -0
- package/dist/cjs/query-executor/noop-query-executor.d.ts +19 -0
- package/dist/cjs/raw-builder/raw-builder.js +1 -1
- package/dist/cjs/schema/alter-table-builder.d.ts +253 -5
- package/dist/cjs/schema/alter-table-builder.js +45 -9
- package/dist/cjs/schema/column-definition-builder.d.ts +146 -6
- package/dist/cjs/schema/column-definition-builder.js +21 -8
- package/dist/cjs/schema/create-index-builder.d.ts +3 -2
- package/dist/cjs/schema/create-index-builder.js +2 -2
- package/dist/cjs/schema/create-table-builder.d.ts +3 -2
- package/dist/cjs/schema/create-table-builder.js +2 -2
- package/dist/esm/{introspection → dialect}/database-introspector.d.ts +0 -0
- package/dist/esm/{introspection → dialect}/database-introspector.js +0 -0
- package/dist/esm/dialect/dialect-adapter-base.d.ts +36 -0
- package/dist/esm/dialect/dialect.d.ts +1 -1
- package/dist/esm/dialect/mysql/mysql-adapter.d.ts +38 -2
- package/dist/esm/dialect/mysql/mysql-adapter.js +2 -1
- package/dist/esm/dialect/mysql/mysql-dialect.d.ts +17 -1
- package/dist/esm/dialect/mysql/mysql-driver.d.ts +29 -0
- package/dist/esm/dialect/mysql/mysql-introspector.d.ts +4 -1
- package/dist/esm/dialect/postgres/postgres-adapter.d.ts +38 -2
- package/dist/esm/dialect/postgres/postgres-adapter.js +2 -1
- package/dist/esm/dialect/postgres/postgres-dialect.d.ts +17 -1
- package/dist/esm/dialect/postgres/postgres-driver.d.ts +29 -0
- package/dist/esm/dialect/postgres/postgres-introspector.d.ts +4 -1
- package/dist/esm/dialect/sqlite/sqlite-adapter.d.ts +38 -2
- package/dist/esm/dialect/sqlite/sqlite-dialect.d.ts +17 -1
- package/dist/esm/dialect/sqlite/sqlite-driver.d.ts +29 -0
- package/dist/esm/dialect/sqlite/sqlite-introspector.d.ts +4 -1
- package/dist/esm/driver/default-connection-provider.d.ts +4 -0
- package/dist/esm/driver/runtime-driver.d.ts +29 -0
- package/dist/esm/driver/single-connection-provider.d.ts +4 -0
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/index.js +3 -2
- package/dist/esm/kysely.d.ts +152 -1
- package/dist/esm/kysely.js +37 -0
- package/dist/esm/migration/migration.d.ts +154 -11
- package/dist/esm/migration/migration.js +255 -134
- package/dist/esm/operation-node/check-constraint-node.d.ts +1 -1
- package/dist/esm/operation-node/check-constraint-node.js +2 -3
- package/dist/esm/operation-node/column-definition-node.d.ts +8 -7
- package/dist/esm/operation-node/column-definition-node.js +0 -4
- package/dist/esm/operation-node/common-table-expression-name-node.d.ts +15 -0
- package/dist/esm/operation-node/common-table-expression-name-node.js +20 -0
- package/dist/esm/operation-node/common-table-expression-node.d.ts +3 -3
- package/dist/esm/operation-node/data-type-node.d.ts +1 -1
- package/dist/esm/operation-node/generated-node.d.ts +20 -0
- package/dist/esm/operation-node/generated-node.js +28 -0
- package/dist/esm/operation-node/on-conflict-node.d.ts +13 -2
- package/dist/esm/operation-node/on-conflict-node.js +39 -1
- package/dist/esm/operation-node/operation-node-transformer.d.ts +4 -2
- package/dist/esm/operation-node/operation-node-transformer.js +22 -6
- package/dist/esm/operation-node/operation-node-visitor.d.ts +4 -2
- package/dist/esm/operation-node/operation-node-visitor.js +2 -1
- package/dist/esm/operation-node/operation-node.d.ts +1 -1
- package/dist/esm/operation-node/with-node.d.ts +3 -1
- package/dist/esm/operation-node/with-node.js +2 -1
- package/dist/esm/package.json +1 -3
- package/dist/esm/parser/parse-context.d.ts +14 -0
- package/dist/esm/parser/with-parser.d.ts +32 -5
- package/dist/esm/parser/with-parser.js +13 -2
- package/dist/esm/plugin/camel-case/camel-case-plugin.d.ts +36 -2
- package/dist/esm/plugin/immediate-value.ts/immediate-value-plugin.d.ts +34 -0
- package/dist/esm/plugin/with-schema/with-schema-plugin.d.ts +34 -0
- package/dist/esm/plugin/with-schema/with-schema-transformer.js +8 -0
- package/dist/esm/query-builder/delete-query-builder.d.ts +545 -0
- package/dist/esm/query-builder/insert-query-builder.d.ts +142 -76
- package/dist/esm/query-builder/insert-query-builder.js +150 -15
- package/dist/esm/query-builder/join-interface.d.ts +3 -6
- package/dist/esm/query-builder/on-conflict-builder.d.ts +684 -0
- package/dist/esm/query-builder/on-conflict-builder.js +317 -0
- package/dist/esm/query-builder/returning-interface.d.ts +1 -1
- package/dist/esm/query-builder/select-query-builder.d.ts +513 -2
- package/dist/esm/query-builder/select-query-builder.js +2 -2
- package/dist/esm/query-builder/update-query-builder.d.ts +547 -2
- package/dist/esm/query-builder/update-query-builder.js +2 -2
- package/dist/esm/query-builder/where-interface.d.ts +7 -10
- package/dist/esm/query-compiler/default-query-compiler.d.ts +4 -2
- package/dist/esm/query-compiler/default-query-compiler.js +48 -8
- package/dist/esm/query-creator.d.ts +27 -3
- package/dist/esm/query-creator.js +33 -1
- package/dist/esm/query-executor/default-query-executor.d.ts +19 -0
- package/dist/esm/query-executor/noop-query-executor.d.ts +19 -0
- package/dist/esm/raw-builder/raw-builder.js +1 -1
- package/dist/esm/schema/alter-table-builder.d.ts +253 -5
- package/dist/esm/schema/alter-table-builder.js +45 -9
- package/dist/esm/schema/column-definition-builder.d.ts +146 -6
- package/dist/esm/schema/column-definition-builder.js +21 -8
- package/dist/esm/schema/create-index-builder.d.ts +3 -2
- package/dist/esm/schema/create-index-builder.js +2 -2
- package/dist/esm/schema/create-table-builder.d.ts +3 -2
- package/dist/esm/schema/create-table-builder.js +2 -2
- package/package.json +8 -6
- package/dist/cjs/operation-node/generated-always-as-node.d.ts +0 -16
- package/dist/cjs/operation-node/generated-always-as-node.js +0 -25
- package/dist/cjs/parser/on-conflict-parser.d.ts +0 -10
- package/dist/cjs/parser/on-conflict-parser.js +0 -35
- package/dist/esm/operation-node/generated-always-as-node.d.ts +0 -16
- package/dist/esm/operation-node/generated-always-as-node.js +0 -22
- package/dist/esm/parser/on-conflict-parser.d.ts +0 -10
- package/dist/esm/parser/on-conflict-parser.js +0 -30
|
@@ -66,6 +66,12 @@ export interface ColumnDefinitionBuilderInterface {
|
|
|
66
66
|
* Adds a `not null` constraint for the column.
|
|
67
67
|
*/
|
|
68
68
|
notNull(): ColumnDefinitionBuilderInterface;
|
|
69
|
+
/**
|
|
70
|
+
* Adds a `unsigned` modifier for the column.
|
|
71
|
+
*
|
|
72
|
+
* This only works on some dialects like MySQL.
|
|
73
|
+
*/
|
|
74
|
+
unsigned(): ColumnDefinitionBuilderInterface;
|
|
69
75
|
/**
|
|
70
76
|
* Adds a default value constraint for the column.
|
|
71
77
|
*
|
|
@@ -87,11 +93,13 @@ export interface ColumnDefinitionBuilderInterface {
|
|
|
87
93
|
* ```ts
|
|
88
94
|
* db.schema
|
|
89
95
|
* .createTable('pet')
|
|
90
|
-
* .addColumn('number_of_legs', 'integer', (col) =>
|
|
96
|
+
* .addColumn('number_of_legs', 'integer', (col) =>
|
|
97
|
+
* col.check(db.raw('number_of_legs < 5'))
|
|
98
|
+
* )
|
|
91
99
|
* .execute()
|
|
92
100
|
* ```
|
|
93
101
|
*/
|
|
94
|
-
check(
|
|
102
|
+
check(expression: AnyRawBuilder): ColumnDefinitionBuilderInterface;
|
|
95
103
|
/**
|
|
96
104
|
* Makes the column a generated column using a `generated always as` statement.
|
|
97
105
|
*
|
|
@@ -101,12 +109,20 @@ export interface ColumnDefinitionBuilderInterface {
|
|
|
101
109
|
* db.schema
|
|
102
110
|
* .createTable('person')
|
|
103
111
|
* .addColumn('full_name', 'varchar(255)',
|
|
104
|
-
* (col) => col.generatedAlwaysAs("concat(first_name, ' ', last_name)")
|
|
112
|
+
* (col) => col.generatedAlwaysAs(db.raw("concat(first_name, ' ', last_name)"))
|
|
105
113
|
* )
|
|
106
114
|
* .execute()
|
|
107
115
|
* ```
|
|
108
116
|
*/
|
|
109
|
-
generatedAlwaysAs(
|
|
117
|
+
generatedAlwaysAs(expression: AnyRawBuilder): ColumnDefinitionBuilderInterface;
|
|
118
|
+
/**
|
|
119
|
+
* Adds the `generated always as identity` specifier on supported dialects.
|
|
120
|
+
*/
|
|
121
|
+
generatedAlwaysAsIdentity(): ColumnDefinitionBuilderInterface;
|
|
122
|
+
/**
|
|
123
|
+
* Adds the `generated by default as identity` specifier on supported dialects.
|
|
124
|
+
*/
|
|
125
|
+
generatedByDefaultAsIdentity(): ColumnDefinitionBuilderInterface;
|
|
110
126
|
/**
|
|
111
127
|
* Makes a generated column stored instead of virtual. This method can only
|
|
112
128
|
* be used with {@link generatedAlwaysAs}
|
|
@@ -128,16 +144,140 @@ export interface ColumnDefinitionBuilderInterface {
|
|
|
128
144
|
export declare class ColumnDefinitionBuilder implements ColumnDefinitionBuilderInterface, OperationNodeSource {
|
|
129
145
|
#private;
|
|
130
146
|
constructor(node: ColumnDefinitionNode);
|
|
147
|
+
/**
|
|
148
|
+
* Adds `auto_increment` or `autoincrement` to the column definition
|
|
149
|
+
* depending on the dialect.
|
|
150
|
+
*
|
|
151
|
+
* Some dialects like PostgreSQL don't support this. On PostgreSQL
|
|
152
|
+
* you can use the `serial` or `bigserial` data type instead.
|
|
153
|
+
*/
|
|
131
154
|
autoIncrement(): ColumnDefinitionBuilder;
|
|
155
|
+
/**
|
|
156
|
+
* Makes the column the primary key.
|
|
157
|
+
*
|
|
158
|
+
* If you want to specify a composite primary key use the
|
|
159
|
+
* {@link TableBuilder.addPrimaryKeyConstraint} method.
|
|
160
|
+
*/
|
|
132
161
|
primaryKey(): ColumnDefinitionBuilder;
|
|
162
|
+
/**
|
|
163
|
+
* Adds a foreign key constraint for the column.
|
|
164
|
+
*
|
|
165
|
+
* If your database engine doesn't support foreign key constraints in the
|
|
166
|
+
* column definition (like MySQL 5) you need to call the table level
|
|
167
|
+
* {@link TableBuilder.addForeignKeyConstraint} method instead.
|
|
168
|
+
*
|
|
169
|
+
* ### Examples
|
|
170
|
+
*
|
|
171
|
+
* ```ts
|
|
172
|
+
* col.references('person.id')
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
133
175
|
references(ref: string): ColumnDefinitionBuilder;
|
|
176
|
+
/**
|
|
177
|
+
* Adds an `on delete` constraint for the foreign key column.
|
|
178
|
+
*
|
|
179
|
+
* If your database engine doesn't support foreign key constraints in the
|
|
180
|
+
* column definition (like MySQL 5) you need to call the table level
|
|
181
|
+
* {@link TableBuilder.addForeignKeyConstraint} method instead.
|
|
182
|
+
*
|
|
183
|
+
* ### Examples
|
|
184
|
+
*
|
|
185
|
+
* ```ts
|
|
186
|
+
* col.references('person.id').onDelete('cascade')
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
134
189
|
onDelete(onDelete: OnModifyForeignAction): ColumnDefinitionBuilder;
|
|
190
|
+
/**
|
|
191
|
+
* Adds an `on update` constraint for the foreign key column.
|
|
192
|
+
*
|
|
193
|
+
* ### Examples
|
|
194
|
+
*
|
|
195
|
+
* ```ts
|
|
196
|
+
* col.references('person.id').onUpdate('cascade')
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
135
199
|
onUpdate(onUpdate: OnModifyForeignAction): ColumnDefinitionBuilder;
|
|
200
|
+
/**
|
|
201
|
+
* Adds a unique constraint for the column.
|
|
202
|
+
*/
|
|
136
203
|
unique(): ColumnDefinitionBuilder;
|
|
204
|
+
/**
|
|
205
|
+
* Adds a `not null` constraint for the column.
|
|
206
|
+
*/
|
|
137
207
|
notNull(): ColumnDefinitionBuilder;
|
|
208
|
+
/**
|
|
209
|
+
* Adds a `unsigned` modifier for the column.
|
|
210
|
+
*
|
|
211
|
+
* This only works on some dialects like MySQL.
|
|
212
|
+
*/
|
|
213
|
+
unsigned(): ColumnDefinitionBuilder;
|
|
214
|
+
/**
|
|
215
|
+
* Adds a default value constraint for the column.
|
|
216
|
+
*
|
|
217
|
+
* ### Examples
|
|
218
|
+
*
|
|
219
|
+
* ```ts
|
|
220
|
+
* db.schema
|
|
221
|
+
* .createTable('pet')
|
|
222
|
+
* .addColumn('number_of_legs', 'integer', (col) => col.defaultTo(4))
|
|
223
|
+
* .execute()
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
138
226
|
defaultTo(value: DefaultValueExpression): ColumnDefinitionBuilder;
|
|
139
|
-
|
|
140
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Adds a check constraint for the column.
|
|
229
|
+
*
|
|
230
|
+
* ### Examples
|
|
231
|
+
*
|
|
232
|
+
* ```ts
|
|
233
|
+
* db.schema
|
|
234
|
+
* .createTable('pet')
|
|
235
|
+
* .addColumn('number_of_legs', 'integer', (col) =>
|
|
236
|
+
* col.check(db.raw('number_of_legs < 5'))
|
|
237
|
+
* )
|
|
238
|
+
* .execute()
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
check(expression: AnyRawBuilder): ColumnDefinitionBuilder;
|
|
242
|
+
/**
|
|
243
|
+
* Makes the column a generated column using a `generated always as` statement.
|
|
244
|
+
*
|
|
245
|
+
* ### Examples
|
|
246
|
+
*
|
|
247
|
+
* ```ts
|
|
248
|
+
* db.schema
|
|
249
|
+
* .createTable('person')
|
|
250
|
+
* .addColumn('full_name', 'varchar(255)',
|
|
251
|
+
* (col) => col.generatedAlwaysAs(db.raw("concat(first_name, ' ', last_name)"))
|
|
252
|
+
* )
|
|
253
|
+
* .execute()
|
|
254
|
+
* ```
|
|
255
|
+
*/
|
|
256
|
+
generatedAlwaysAs(expression: AnyRawBuilder): ColumnDefinitionBuilder;
|
|
257
|
+
/**
|
|
258
|
+
* Adds the `generated always as identity` specifier on supported dialects.
|
|
259
|
+
*/
|
|
260
|
+
generatedAlwaysAsIdentity(): ColumnDefinitionBuilder;
|
|
261
|
+
/**
|
|
262
|
+
* Adds the `generated by default as identity` specifier on supported dialects.
|
|
263
|
+
*/
|
|
264
|
+
generatedByDefaultAsIdentity(): ColumnDefinitionBuilder;
|
|
265
|
+
/**
|
|
266
|
+
* Makes a generated column stored instead of virtual. This method can only
|
|
267
|
+
* be used with {@link generatedAlwaysAs}
|
|
268
|
+
*
|
|
269
|
+
* ### Examples
|
|
270
|
+
*
|
|
271
|
+
* ```ts
|
|
272
|
+
* db.schema
|
|
273
|
+
* .createTable('person')
|
|
274
|
+
* .addColumn('full_name', 'varchar(255)', (col) => col
|
|
275
|
+
* .generatedAlwaysAs("concat(first_name, ' ', last_name)")
|
|
276
|
+
* .stored()
|
|
277
|
+
* )
|
|
278
|
+
* .execute()
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
141
281
|
stored(): ColumnDefinitionBuilder;
|
|
142
282
|
toOperationNode(): ColumnDefinitionNode;
|
|
143
283
|
}
|
|
@@ -9,7 +9,7 @@ const reference_parser_js_1 = require("../parser/reference-parser.js");
|
|
|
9
9
|
const prevent_await_js_1 = require("../util/prevent-await.js");
|
|
10
10
|
const column_definition_node_js_1 = require("../operation-node/column-definition-node.js");
|
|
11
11
|
const default_value_parser_js_1 = require("../parser/default-value-parser.js");
|
|
12
|
-
const
|
|
12
|
+
const generated_node_js_1 = require("../operation-node/generated-node.js");
|
|
13
13
|
const default_value_node_js_1 = require("../operation-node/default-value-node.js");
|
|
14
14
|
class ColumnDefinitionBuilder {
|
|
15
15
|
#node;
|
|
@@ -53,29 +53,42 @@ class ColumnDefinitionBuilder {
|
|
|
53
53
|
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, { unique: true }));
|
|
54
54
|
}
|
|
55
55
|
notNull() {
|
|
56
|
-
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, {
|
|
56
|
+
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, { notNull: true }));
|
|
57
|
+
}
|
|
58
|
+
unsigned() {
|
|
59
|
+
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, { unsigned: true }));
|
|
57
60
|
}
|
|
58
61
|
defaultTo(value) {
|
|
59
62
|
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, {
|
|
60
63
|
defaultTo: default_value_node_js_1.DefaultValueNode.create((0, default_value_parser_js_1.parseDefaultValueExpression)(value)),
|
|
61
64
|
}));
|
|
62
65
|
}
|
|
63
|
-
check(
|
|
66
|
+
check(expression) {
|
|
67
|
+
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, {
|
|
68
|
+
check: check_constraint_node_js_1.CheckConstraintNode.create(expression.toOperationNode()),
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
generatedAlwaysAs(expression) {
|
|
72
|
+
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, {
|
|
73
|
+
generated: generated_node_js_1.GeneratedNode.createWithExpression(expression.toOperationNode()),
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
generatedAlwaysAsIdentity() {
|
|
64
77
|
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, {
|
|
65
|
-
|
|
78
|
+
generated: generated_node_js_1.GeneratedNode.create({ identity: true, always: true }),
|
|
66
79
|
}));
|
|
67
80
|
}
|
|
68
|
-
|
|
81
|
+
generatedByDefaultAsIdentity() {
|
|
69
82
|
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, {
|
|
70
|
-
|
|
83
|
+
generated: generated_node_js_1.GeneratedNode.create({ identity: true, byDefault: true }),
|
|
71
84
|
}));
|
|
72
85
|
}
|
|
73
86
|
stored() {
|
|
74
|
-
if (!this.#node.
|
|
87
|
+
if (!this.#node.generated) {
|
|
75
88
|
throw new Error('stored() can only be called after generatedAlwaysAs');
|
|
76
89
|
}
|
|
77
90
|
return new ColumnDefinitionBuilder(column_definition_node_js_1.ColumnDefinitionNode.cloneWith(this.#node, {
|
|
78
|
-
|
|
91
|
+
generated: generated_node_js_1.GeneratedNode.cloneWith(this.#node.generated, {
|
|
79
92
|
stored: true,
|
|
80
93
|
}),
|
|
81
94
|
}));
|
|
@@ -4,6 +4,7 @@ import { CompiledQuery } from '../query-compiler/compiled-query.js';
|
|
|
4
4
|
import { Compilable } from '../util/compilable.js';
|
|
5
5
|
import { QueryExecutor } from '../query-executor/query-executor.js';
|
|
6
6
|
import { QueryId } from '../util/query-id.js';
|
|
7
|
+
import { AnyRawBuilder } from '../util/type-utils.js';
|
|
7
8
|
export declare class CreateIndexBuilder implements OperationNodeSource, Compilable {
|
|
8
9
|
#private;
|
|
9
10
|
constructor(props: CreateIndexBuilderProps);
|
|
@@ -36,11 +37,11 @@ export declare class CreateIndexBuilder implements OperationNodeSource, Compilab
|
|
|
36
37
|
* await db.schema
|
|
37
38
|
* .createIndex('person_first_name_index')
|
|
38
39
|
* .on('person')
|
|
39
|
-
* .expression('first_name COLLATE "fi_FI"')
|
|
40
|
+
* .expression(db.raw('first_name COLLATE "fi_FI"'))
|
|
40
41
|
* .execute()
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
43
|
-
expression(expression:
|
|
44
|
+
expression(expression: AnyRawBuilder): CreateIndexBuilder;
|
|
44
45
|
/**
|
|
45
46
|
* Specifies the index type.
|
|
46
47
|
*/
|
|
@@ -70,7 +70,7 @@ class CreateIndexBuilder {
|
|
|
70
70
|
* await db.schema
|
|
71
71
|
* .createIndex('person_first_name_index')
|
|
72
72
|
* .on('person')
|
|
73
|
-
* .expression('first_name COLLATE "fi_FI"')
|
|
73
|
+
* .expression(db.raw('first_name COLLATE "fi_FI"'))
|
|
74
74
|
* .execute()
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
@@ -78,7 +78,7 @@ class CreateIndexBuilder {
|
|
|
78
78
|
return new CreateIndexBuilder({
|
|
79
79
|
...this.#props,
|
|
80
80
|
createIndexNode: create_index_node_js_1.CreateIndexNode.cloneWith(this.#props.createIndexNode, {
|
|
81
|
-
expression:
|
|
81
|
+
expression: expression.toOperationNode(),
|
|
82
82
|
}),
|
|
83
83
|
});
|
|
84
84
|
}
|
|
@@ -7,6 +7,7 @@ import { ColumnDefinitionBuilder } from './column-definition-builder.js';
|
|
|
7
7
|
import { QueryId } from '../util/query-id.js';
|
|
8
8
|
import { ForeignKeyConstraintBuilder } from './foreign-key-constraint-builder.js';
|
|
9
9
|
import { DataTypeExpression } from '../parser/data-type-parser.js';
|
|
10
|
+
import { AnyRawBuilder } from '../util/type-utils.js';
|
|
10
11
|
/**
|
|
11
12
|
* This builder can be used to create a `create table` query.
|
|
12
13
|
*/
|
|
@@ -110,10 +111,10 @@ export declare class CreateTableBuilder<TB extends string, C extends string = ne
|
|
|
110
111
|
* ### Examples
|
|
111
112
|
*
|
|
112
113
|
* ```ts
|
|
113
|
-
* addCheckConstraint('check_legs', 'number_of_legs < 5')
|
|
114
|
+
* addCheckConstraint('check_legs', db.raw('number_of_legs < 5'))
|
|
114
115
|
* ```
|
|
115
116
|
*/
|
|
116
|
-
addCheckConstraint(constraintName: string, checkExpression:
|
|
117
|
+
addCheckConstraint(constraintName: string, checkExpression: AnyRawBuilder): CreateTableBuilder<TB, C>;
|
|
117
118
|
/**
|
|
118
119
|
* Adds a foreign key constraint.
|
|
119
120
|
*
|
|
@@ -156,13 +156,13 @@ class CreateTableBuilder {
|
|
|
156
156
|
* ### Examples
|
|
157
157
|
*
|
|
158
158
|
* ```ts
|
|
159
|
-
* addCheckConstraint('check_legs', 'number_of_legs < 5')
|
|
159
|
+
* addCheckConstraint('check_legs', db.raw('number_of_legs < 5'))
|
|
160
160
|
* ```
|
|
161
161
|
*/
|
|
162
162
|
addCheckConstraint(constraintName, checkExpression) {
|
|
163
163
|
return new CreateTableBuilder({
|
|
164
164
|
...this.#props,
|
|
165
|
-
createTableNode: create_table_node_js_1.CreateTableNode.cloneWithConstraint(this.#props.createTableNode, check_constraint_node_js_1.CheckConstraintNode.create(checkExpression, constraintName)),
|
|
165
|
+
createTableNode: create_table_node_js_1.CreateTableNode.cloneWithConstraint(this.#props.createTableNode, check_constraint_node_js_1.CheckConstraintNode.create(checkExpression.toOperationNode(), constraintName)),
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
File without changes
|
|
File without changes
|
|
@@ -7,8 +7,44 @@ import { DialectAdapter } from './dialect-adapter.js';
|
|
|
7
7
|
* they are added and there will be less breaking changes.
|
|
8
8
|
*/
|
|
9
9
|
export declare abstract class DialectAdapterBase implements DialectAdapter {
|
|
10
|
+
/**
|
|
11
|
+
* Whether or not this dialect supports transactional DDL.
|
|
12
|
+
*
|
|
13
|
+
* If this is true, migrations are executed inside a transaction.
|
|
14
|
+
*/
|
|
10
15
|
get supportsTransactionalDdl(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether or not this dialect supports the `returning` in inserts
|
|
18
|
+
* updates and deletes.
|
|
19
|
+
*/
|
|
11
20
|
get supportsReturning(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* This method is used to acquire a lock for the migrations so that
|
|
23
|
+
* it's not possible for two migration processes to run in parallel.
|
|
24
|
+
*
|
|
25
|
+
* Most dialects have explicit locks that can be used, like advisory locks
|
|
26
|
+
* in PostgreSQL and the get_lock function in MySQL.
|
|
27
|
+
*
|
|
28
|
+
* If the dialect doesn't have explicit locks the {@link MIGRATION_LOCK_TABLE}
|
|
29
|
+
* created by Kysely can be used instead. {@link MIGRATION_LOCK_TABLE}
|
|
30
|
+
* has two columns `id` and `is_locked` and there's only one row in the
|
|
31
|
+
* table whose id is {@link MIGRATION_LOCK_ID}. `is_locked` is an integer.
|
|
32
|
+
* Kysely takes care of creating the lock table and inserting the one single
|
|
33
|
+
* row to it before this method is executed.
|
|
34
|
+
*
|
|
35
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
36
|
+
* is a transaction inside which the migrations will be executed. Otherwise
|
|
37
|
+
* `db` is a single connection (session) that will be used to execute the
|
|
38
|
+
* migrations.
|
|
39
|
+
*/
|
|
12
40
|
abstract acquireMigrationLock(db: Kysely<any>): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Releases the migration lock. See {@link acquireMigrationLock}.
|
|
43
|
+
*
|
|
44
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
45
|
+
* is a transaction inside which the migrations were executed. Otherwise `db`
|
|
46
|
+
* is a single connection (session) that was used to execute the migrations
|
|
47
|
+
* and the `acquireMigrationLock` call.
|
|
48
|
+
*/
|
|
13
49
|
abstract releaseMigrationLock(db: Kysely<any>): Promise<void>;
|
|
14
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Driver } from '../driver/driver.js';
|
|
2
2
|
import { Kysely } from '../kysely.js';
|
|
3
3
|
import { QueryCompiler } from '../query-compiler/query-compiler.js';
|
|
4
|
-
import { DatabaseIntrospector } from '
|
|
4
|
+
import { DatabaseIntrospector } from './database-introspector.js';
|
|
5
5
|
import { DialectAdapter } from './dialect-adapter.js';
|
|
6
6
|
/**
|
|
7
7
|
* A Dialect is the glue between Kysely and the underlying database engine.
|
|
@@ -1,8 +1,44 @@
|
|
|
1
1
|
import { Kysely } from '../../kysely.js';
|
|
2
|
-
import {
|
|
3
|
-
export declare class MysqlAdapter
|
|
2
|
+
import { DialectAdapterBase } from '../dialect-adapter-base.js';
|
|
3
|
+
export declare class MysqlAdapter extends DialectAdapterBase {
|
|
4
|
+
/**
|
|
5
|
+
* Whether or not this dialect supports transactional DDL.
|
|
6
|
+
*
|
|
7
|
+
* If this is true, migrations are executed inside a transaction.
|
|
8
|
+
*/
|
|
4
9
|
get supportsTransactionalDdl(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether or not this dialect supports the `returning` in inserts
|
|
12
|
+
* updates and deletes.
|
|
13
|
+
*/
|
|
5
14
|
get supportsReturning(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* This method is used to acquire a lock for the migrations so that
|
|
17
|
+
* it's not possible for two migration processes to run in parallel.
|
|
18
|
+
*
|
|
19
|
+
* Most dialects have explicit locks that can be used, like advisory locks
|
|
20
|
+
* in PostgreSQL and the get_lock function in MySQL.
|
|
21
|
+
*
|
|
22
|
+
* If the dialect doesn't have explicit locks the {@link MIGRATION_LOCK_TABLE}
|
|
23
|
+
* created by Kysely can be used instead. {@link MIGRATION_LOCK_TABLE}
|
|
24
|
+
* has two columns `id` and `is_locked` and there's only one row in the
|
|
25
|
+
* table whose id is {@link MIGRATION_LOCK_ID}. `is_locked` is an integer.
|
|
26
|
+
* Kysely takes care of creating the lock table and inserting the one single
|
|
27
|
+
* row to it before this method is executed.
|
|
28
|
+
*
|
|
29
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
30
|
+
* is a transaction inside which the migrations will be executed. Otherwise
|
|
31
|
+
* `db` is a single connection (session) that will be used to execute the
|
|
32
|
+
* migrations.
|
|
33
|
+
*/
|
|
6
34
|
acquireMigrationLock(db: Kysely<any>): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Releases the migration lock. See {@link acquireMigrationLock}.
|
|
37
|
+
*
|
|
38
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
39
|
+
* is a transaction inside which the migrations were executed. Otherwise `db`
|
|
40
|
+
* is a single connection (session) that was used to execute the migrations
|
|
41
|
+
* and the `acquireMigrationLock` call.
|
|
42
|
+
*/
|
|
7
43
|
releaseMigrationLock(db: Kysely<any>): Promise<void>;
|
|
8
44
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DialectAdapterBase } from '../dialect-adapter-base.js';
|
|
1
2
|
const LOCK_ID = 'ea586330-2c93-47c8-908d-981d9d270f9d';
|
|
2
3
|
const LOCK_TIMEOUT_SECONDS = 60 * 60;
|
|
3
|
-
export class MysqlAdapter {
|
|
4
|
+
export class MysqlAdapter extends DialectAdapterBase {
|
|
4
5
|
get supportsTransactionalDdl() {
|
|
5
6
|
return false;
|
|
6
7
|
}
|
|
@@ -2,7 +2,7 @@ import { Driver } from '../../driver/driver.js';
|
|
|
2
2
|
import { Kysely } from '../../kysely.js';
|
|
3
3
|
import { QueryCompiler } from '../../query-compiler/query-compiler.js';
|
|
4
4
|
import { Dialect } from '../dialect.js';
|
|
5
|
-
import { DatabaseIntrospector } from '
|
|
5
|
+
import { DatabaseIntrospector } from '../database-introspector.js';
|
|
6
6
|
import { DialectAdapter } from '../dialect-adapter.js';
|
|
7
7
|
import { DatabaseConnection } from '../../driver/database-connection.js';
|
|
8
8
|
/**
|
|
@@ -15,9 +15,25 @@ import { DatabaseConnection } from '../../driver/database-connection.js';
|
|
|
15
15
|
export declare class MysqlDialect implements Dialect {
|
|
16
16
|
#private;
|
|
17
17
|
constructor(config: MysqlDialectConfig);
|
|
18
|
+
/**
|
|
19
|
+
* Creates a driver for the dialect.
|
|
20
|
+
*/
|
|
18
21
|
createDriver(): Driver;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a query compiler for the dialect.
|
|
24
|
+
*/
|
|
19
25
|
createQueryCompiler(): QueryCompiler;
|
|
26
|
+
/**
|
|
27
|
+
* Creates an adapter for the dialect.
|
|
28
|
+
*/
|
|
20
29
|
createAdapter(): DialectAdapter;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a database introspector that can be used to get the database metadata
|
|
32
|
+
* such as the tables and columns that exist in the database.
|
|
33
|
+
*
|
|
34
|
+
* `db` never has any plugins installed. It's created using
|
|
35
|
+
* {@link Kysely.withoutPlugins}.
|
|
36
|
+
*/
|
|
21
37
|
createIntrospector(db: Kysely<any>): DatabaseIntrospector;
|
|
22
38
|
}
|
|
23
39
|
/**
|
|
@@ -4,11 +4,40 @@ import { MysqlDialectConfig } from './mysql-dialect.js';
|
|
|
4
4
|
export declare class MysqlDriver implements Driver {
|
|
5
5
|
#private;
|
|
6
6
|
constructor(config: MysqlDialectConfig);
|
|
7
|
+
/**
|
|
8
|
+
* Initializes the driver.
|
|
9
|
+
*
|
|
10
|
+
* After calling this method the driver should be usable and `acquireConnection` etc.
|
|
11
|
+
* methods should be callable.
|
|
12
|
+
*
|
|
13
|
+
* IMPORTANT: The underlying database engine driver (like [pg](https://node-postgres.com/))
|
|
14
|
+
* should be imported inside this function, not at the top of the driver file! This is
|
|
15
|
+
* important so that Kysely is usable without installing all database driver libraries
|
|
16
|
+
* it supports.
|
|
17
|
+
*/
|
|
7
18
|
init(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Acquires a new connection from the pool.
|
|
21
|
+
*/
|
|
8
22
|
acquireConnection(): Promise<DatabaseConnection>;
|
|
23
|
+
/**
|
|
24
|
+
* Begins a transaction.
|
|
25
|
+
*/
|
|
9
26
|
beginTransaction(connection: DatabaseConnection, settings: TransactionSettings): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Commits a transaction.
|
|
29
|
+
*/
|
|
10
30
|
commitTransaction(connection: DatabaseConnection): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Rolls back a transaction.
|
|
33
|
+
*/
|
|
11
34
|
rollbackTransaction(connection: DatabaseConnection): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Releases a connection back to the pool.
|
|
37
|
+
*/
|
|
12
38
|
releaseConnection(connection: DatabaseConnection): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Destroys the driver and releases all resources.
|
|
41
|
+
*/
|
|
13
42
|
destroy(): Promise<void>;
|
|
14
43
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { DatabaseIntrospector, DatabaseMetadata, DatabaseMetadataOptions } from '
|
|
1
|
+
import { DatabaseIntrospector, DatabaseMetadata, DatabaseMetadataOptions } from '../database-introspector.js';
|
|
2
2
|
import { Kysely } from '../../kysely.js';
|
|
3
3
|
export declare class MysqlIntrospector implements DatabaseIntrospector {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(db: Kysely<any>);
|
|
6
|
+
/**
|
|
7
|
+
* Get the database metadata such as the names of the tables and columns.
|
|
8
|
+
*/
|
|
6
9
|
getMetadata(options?: DatabaseMetadataOptions): Promise<DatabaseMetadata>;
|
|
7
10
|
}
|
|
@@ -1,8 +1,44 @@
|
|
|
1
1
|
import { Kysely } from '../../kysely.js';
|
|
2
|
-
import {
|
|
3
|
-
export declare class PostgresAdapter
|
|
2
|
+
import { DialectAdapterBase } from '../dialect-adapter-base.js';
|
|
3
|
+
export declare class PostgresAdapter extends DialectAdapterBase {
|
|
4
|
+
/**
|
|
5
|
+
* Whether or not this dialect supports transactional DDL.
|
|
6
|
+
*
|
|
7
|
+
* If this is true, migrations are executed inside a transaction.
|
|
8
|
+
*/
|
|
4
9
|
get supportsTransactionalDdl(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether or not this dialect supports the `returning` in inserts
|
|
12
|
+
* updates and deletes.
|
|
13
|
+
*/
|
|
5
14
|
get supportsReturning(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* This method is used to acquire a lock for the migrations so that
|
|
17
|
+
* it's not possible for two migration processes to run in parallel.
|
|
18
|
+
*
|
|
19
|
+
* Most dialects have explicit locks that can be used, like advisory locks
|
|
20
|
+
* in PostgreSQL and the get_lock function in MySQL.
|
|
21
|
+
*
|
|
22
|
+
* If the dialect doesn't have explicit locks the {@link MIGRATION_LOCK_TABLE}
|
|
23
|
+
* created by Kysely can be used instead. {@link MIGRATION_LOCK_TABLE}
|
|
24
|
+
* has two columns `id` and `is_locked` and there's only one row in the
|
|
25
|
+
* table whose id is {@link MIGRATION_LOCK_ID}. `is_locked` is an integer.
|
|
26
|
+
* Kysely takes care of creating the lock table and inserting the one single
|
|
27
|
+
* row to it before this method is executed.
|
|
28
|
+
*
|
|
29
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
30
|
+
* is a transaction inside which the migrations will be executed. Otherwise
|
|
31
|
+
* `db` is a single connection (session) that will be used to execute the
|
|
32
|
+
* migrations.
|
|
33
|
+
*/
|
|
6
34
|
acquireMigrationLock(db: Kysely<any>): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Releases the migration lock. See {@link acquireMigrationLock}.
|
|
37
|
+
*
|
|
38
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
39
|
+
* is a transaction inside which the migrations were executed. Otherwise `db`
|
|
40
|
+
* is a single connection (session) that was used to execute the migrations
|
|
41
|
+
* and the `acquireMigrationLock` call.
|
|
42
|
+
*/
|
|
7
43
|
releaseMigrationLock(): Promise<void>;
|
|
8
44
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DialectAdapterBase } from '../dialect-adapter-base.js';
|
|
1
2
|
// Random id for our transaction lock.
|
|
2
3
|
const LOCK_ID = '3853314791062309107';
|
|
3
|
-
export class PostgresAdapter {
|
|
4
|
+
export class PostgresAdapter extends DialectAdapterBase {
|
|
4
5
|
get supportsTransactionalDdl() {
|
|
5
6
|
return true;
|
|
6
7
|
}
|
|
@@ -5,7 +5,7 @@ import { Driver } from '../../driver/driver.js';
|
|
|
5
5
|
import { Kysely } from '../../kysely.js';
|
|
6
6
|
import { QueryCompiler } from '../../query-compiler/query-compiler.js';
|
|
7
7
|
import { Dialect } from '../dialect.js';
|
|
8
|
-
import { DatabaseIntrospector } from '
|
|
8
|
+
import { DatabaseIntrospector } from '../database-introspector.js';
|
|
9
9
|
import { DialectAdapter } from '../dialect-adapter.js';
|
|
10
10
|
import { DatabaseConnection } from '../../driver/database-connection.js';
|
|
11
11
|
/**
|
|
@@ -21,9 +21,25 @@ import { DatabaseConnection } from '../../driver/database-connection.js';
|
|
|
21
21
|
export declare class PostgresDialect implements Dialect {
|
|
22
22
|
#private;
|
|
23
23
|
constructor(config: PostgresDialectConfig);
|
|
24
|
+
/**
|
|
25
|
+
* Creates a driver for the dialect.
|
|
26
|
+
*/
|
|
24
27
|
createDriver(): Driver;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a query compiler for the dialect.
|
|
30
|
+
*/
|
|
25
31
|
createQueryCompiler(): QueryCompiler;
|
|
32
|
+
/**
|
|
33
|
+
* Creates an adapter for the dialect.
|
|
34
|
+
*/
|
|
26
35
|
createAdapter(): DialectAdapter;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a database introspector that can be used to get the database metadata
|
|
38
|
+
* such as the tables and columns that exist in the database.
|
|
39
|
+
*
|
|
40
|
+
* `db` never has any plugins installed. It's created using
|
|
41
|
+
* {@link Kysely.withoutPlugins}.
|
|
42
|
+
*/
|
|
27
43
|
createIntrospector(db: Kysely<any>): DatabaseIntrospector;
|
|
28
44
|
}
|
|
29
45
|
/**
|