forked from kysely-org/kysely
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdialect-adapter-base.ts
More file actions
40 lines (33 loc) · 1015 Bytes
/
dialect-adapter-base.ts
File metadata and controls
40 lines (33 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Kysely } from '../kysely.js'
import { DialectAdapter, MigrationLockOptions } from './dialect-adapter.js'
/**
* A basic implementation of `DialectAdapter` with sensible default values.
* Third-party dialects can extend this instead of implementing the `DialectAdapter`
* interface from scratch. That way all new settings will get default values when
* they are added and there will be less breaking changes.
*/
export abstract class DialectAdapterBase implements DialectAdapter {
get supportsCreateIfNotExists(): boolean {
return true
}
get supportsTransactionalDdl(): boolean {
return false
}
get supportsReturning(): boolean {
return false
}
get supportsOutput(): boolean {
return false
}
get supportsBatch(): boolean {
return false
}
abstract acquireMigrationLock(
db: Kysely<any>,
options: MigrationLockOptions,
): Promise<void>
abstract releaseMigrationLock(
db: Kysely<any>,
options: MigrationLockOptions,
): Promise<void>
}