Skip to content

Commit f3fb1a5

Browse files
committed
Makes dialect adapter properties optional
Makes the `supportsCreateIfNotExists`, `supportsMultipleConnections`, `supportsTransactionalDdl`, `supportsReturning`, and `supportsOutput` properties of the `DialectAdapter` interface optional. This allows dialects to rely on the default `false` or `true` values without explicitly setting them.
1 parent 0d59f19 commit f3fb1a5

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

src/dialect/dialect-adapter.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,47 @@ export interface DialectAdapter {
1212
/**
1313
* Whether or not this dialect supports `if not exists` in creation of tables/schemas/views/etc.
1414
*
15+
* Default is `false`.
16+
*
1517
* If this is false, Kysely's internal migrations tables and schemas are created
1618
* without `if not exists` in migrations. This is not a problem if the dialect
1719
* supports transactional DDL.
1820
*/
19-
readonly supportsCreateIfNotExists: boolean
21+
readonly supportsCreateIfNotExists?: boolean
2022

2123
/**
2224
* Whether or not this dialect supports multiple connections at the same time.
2325
*
26+
* Default is `true`.
27+
*
2428
* If this is false, Kysely will use a single connection for all database operations.
2529
*/
26-
readonly supportsMultipleConnections: boolean
30+
readonly supportsMultipleConnections?: boolean
2731

2832
/**
2933
* Whether or not this dialect supports transactional DDL.
3034
*
35+
* Default is `false`.
36+
*
3137
* If this is true, migrations are executed inside a transaction.
3238
*/
33-
readonly supportsTransactionalDdl: boolean
39+
readonly supportsTransactionalDdl?: boolean
3440

3541
/**
3642
* Whether or not this dialect supports the `returning` in inserts
3743
* updates and deletes.
44+
*
45+
* Default is `false`.
3846
*/
39-
readonly supportsReturning: boolean
47+
readonly supportsReturning?: boolean
4048

4149
/**
4250
* Whether or not this dialect supports the `output` clause in inserts
4351
* updates and deletes.
52+
*
53+
* Default is `false`.
4454
*/
45-
readonly supportsOutput: boolean
55+
readonly supportsOutput?: boolean
4656

4757
/**
4858
* This method is used to acquire a lock for the migrations so that

0 commit comments

Comments
 (0)