kysely 0.27.4 → 0.27.6
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/.renovaterc.json +3 -0
- package/CODE_OF_CONDUCT.md +183 -0
- package/CONTRIBUTING.md +121 -23
- package/FUNDING.md +25 -0
- package/README.md +13 -2
- package/deno.check.d.ts +86 -0
- package/deno.check.json +21 -0
- package/dist/cjs/dialect/dialect-adapter-base.d.ts +11 -2
- package/dist/cjs/dialect/dialect-adapter.d.ts +11 -2
- package/dist/cjs/dialect/mssql/mssql-adapter.d.ts +11 -2
- package/dist/cjs/dialect/mssql/mssql-dialect-config.d.ts +37 -29
- package/dist/cjs/dialect/mssql/mssql-driver.js +20 -13
- package/dist/cjs/dialect/mysql/mysql-adapter.d.ts +11 -2
- package/dist/cjs/dialect/mysql/mysql-dialect-config.d.ts +4 -0
- package/dist/cjs/dialect/mysql/mysql-driver.js +3 -0
- package/dist/cjs/dialect/postgres/postgres-adapter.d.ts +11 -2
- package/dist/cjs/dialect/postgres/postgres-dialect-config.d.ts +10 -3
- package/dist/cjs/dialect/postgres/postgres-driver.js +3 -0
- package/dist/cjs/dialect/postgres/postgres-introspector.js +5 -1
- package/dist/cjs/dialect/sqlite/sqlite-adapter.d.ts +11 -2
- package/dist/cjs/dialect/sqlite/sqlite-introspector.js +66 -44
- package/dist/cjs/driver/dummy-driver.d.ts +13 -12
- package/dist/cjs/driver/dummy-driver.js +13 -12
- package/dist/cjs/dynamic/dynamic.d.ts +6 -6
- package/dist/cjs/dynamic/dynamic.js +6 -6
- package/dist/cjs/expression/expression-builder.d.ts +154 -61
- package/dist/cjs/expression/expression-wrapper.d.ts +92 -23
- package/dist/cjs/expression/expression.d.ts +40 -5
- package/dist/cjs/helpers/mssql.d.ts +74 -14
- package/dist/cjs/helpers/mssql.js +74 -14
- package/dist/cjs/helpers/mysql.d.ts +14 -10
- package/dist/cjs/helpers/mysql.js +14 -10
- package/dist/cjs/helpers/postgres.d.ts +7 -4
- package/dist/cjs/helpers/postgres.js +7 -4
- package/dist/cjs/helpers/sqlite.d.ts +41 -16
- package/dist/cjs/helpers/sqlite.js +41 -16
- package/dist/cjs/kysely.d.ts +99 -41
- package/dist/cjs/kysely.js +60 -36
- package/dist/cjs/migration/file-migration-provider.d.ts +2 -2
- package/dist/cjs/migration/file-migration-provider.js +2 -2
- package/dist/cjs/migration/migrator.d.ts +90 -15
- package/dist/cjs/migration/migrator.js +95 -17
- package/dist/cjs/operation-node/aggregate-function-node.d.ts +4 -0
- package/dist/cjs/operation-node/aggregate-function-node.js +9 -0
- package/dist/cjs/operation-node/data-type-node.d.ts +1 -1
- package/dist/cjs/operation-node/data-type-node.js +12 -0
- package/dist/cjs/operation-node/delete-query-node.d.ts +1 -0
- package/dist/cjs/operation-node/insert-query-node.d.ts +1 -0
- package/dist/cjs/operation-node/merge-query-node.d.ts +1 -0
- package/dist/cjs/operation-node/operation-node-transformer.d.ts +9 -3
- package/dist/cjs/operation-node/operation-node-transformer.js +14 -3
- package/dist/cjs/operation-node/query-node.d.ts +4 -0
- package/dist/cjs/operation-node/query-node.js +8 -0
- package/dist/cjs/operation-node/select-query-node.d.ts +0 -1
- package/dist/cjs/operation-node/select-query-node.js +0 -8
- package/dist/cjs/operation-node/update-query-node.d.ts +1 -0
- package/dist/cjs/parser/insert-values-parser.js +3 -1
- package/dist/cjs/plugin/camel-case/camel-case-plugin.d.ts +52 -25
- package/dist/cjs/plugin/camel-case/camel-case-plugin.js +24 -19
- package/dist/cjs/plugin/camel-case/camel-case.js +4 -1
- package/dist/cjs/plugin/deduplicate-joins/deduplicate-joins-plugin.d.ts +29 -7
- package/dist/cjs/plugin/deduplicate-joins/deduplicate-joins-plugin.js +1 -1
- package/dist/cjs/plugin/deduplicate-joins/deduplicate-joins-transformer.js +2 -2
- package/dist/cjs/plugin/immediate-value/immediate-value-plugin.d.ts +28 -6
- package/dist/cjs/plugin/kysely-plugin.d.ts +28 -6
- package/dist/cjs/plugin/noop-plugin.d.ts +28 -6
- package/dist/cjs/plugin/parse-json-results/parse-json-results-plugin.d.ts +62 -9
- package/dist/cjs/plugin/parse-json-results/parse-json-results-plugin.js +34 -3
- package/dist/cjs/plugin/with-schema/with-schema-plugin.d.ts +28 -6
- package/dist/cjs/plugin/with-schema/with-schema-transformer.d.ts +4 -0
- package/dist/cjs/plugin/with-schema/with-schema-transformer.js +26 -0
- package/dist/cjs/query-builder/aggregate-function-builder.d.ts +43 -1
- package/dist/cjs/query-builder/aggregate-function-builder.js +30 -0
- package/dist/cjs/query-builder/delete-query-builder.d.ts +137 -45
- package/dist/cjs/query-builder/delete-query-builder.js +76 -26
- package/dist/cjs/query-builder/function-module.d.ts +35 -88
- package/dist/cjs/query-builder/insert-query-builder.d.ts +239 -65
- package/dist/cjs/query-builder/insert-query-builder.js +188 -52
- package/dist/cjs/query-builder/insert-result.d.ts +10 -5
- package/dist/cjs/query-builder/insert-result.js +10 -5
- package/dist/cjs/query-builder/json-path-builder.d.ts +33 -9
- package/dist/cjs/query-builder/json-path-builder.js +8 -5
- package/dist/cjs/query-builder/merge-query-builder.d.ts +159 -21
- package/dist/cjs/query-builder/merge-query-builder.js +68 -6
- package/dist/cjs/query-builder/on-conflict-builder.d.ts +51 -18
- package/dist/cjs/query-builder/on-conflict-builder.js +41 -16
- package/dist/cjs/query-builder/output-interface.d.ts +50 -7
- package/dist/cjs/query-builder/returning-interface.d.ts +5 -5
- package/dist/cjs/query-builder/select-query-builder-expression.d.ts +8 -0
- package/dist/cjs/query-builder/select-query-builder.d.ts +295 -63
- package/dist/cjs/query-builder/select-query-builder.js +7 -7
- package/dist/cjs/query-builder/update-query-builder.d.ts +138 -29
- package/dist/cjs/query-builder/update-query-builder.js +75 -10
- package/dist/cjs/query-builder/update-result.d.ts +2 -2
- package/dist/cjs/query-builder/update-result.js +2 -2
- package/dist/cjs/query-builder/where-interface.d.ts +5 -1
- package/dist/cjs/query-compiler/default-query-compiler.js +20 -0
- package/dist/cjs/query-creator.d.ts +66 -18
- package/dist/cjs/query-creator.js +2 -2
- package/dist/cjs/raw-builder/raw-builder.d.ts +29 -7
- package/dist/cjs/raw-builder/sql.d.ts +27 -8
- package/dist/cjs/schema/alter-column-builder.d.ts +17 -3
- package/dist/cjs/schema/alter-column-builder.js +17 -3
- package/dist/cjs/schema/alter-table-add-index-builder.d.ts +43 -9
- package/dist/cjs/schema/alter-table-add-index-builder.js +26 -9
- package/dist/cjs/schema/column-definition-builder.d.ts +283 -26
- package/dist/cjs/schema/column-definition-builder.js +283 -26
- package/dist/cjs/schema/create-table-builder.d.ts +86 -33
- package/dist/cjs/schema/create-table-builder.js +86 -33
- package/dist/cjs/util/column-type.d.ts +5 -9
- package/dist/cjs/util/require-all-props.d.ts +4 -2
- package/dist/cjs/util/require-all-props.js +4 -2
- package/dist/cjs/util/streamable.d.ts +1 -1
- package/dist/cjs/util/type-utils.d.ts +4 -2
- package/dist/esm/dialect/dialect-adapter-base.d.ts +11 -2
- package/dist/esm/dialect/dialect-adapter.d.ts +11 -2
- package/dist/esm/dialect/mssql/mssql-adapter.d.ts +11 -2
- package/dist/esm/dialect/mssql/mssql-dialect-config.d.ts +37 -29
- package/dist/esm/dialect/mssql/mssql-driver.js +20 -13
- package/dist/esm/dialect/mysql/mysql-adapter.d.ts +11 -2
- package/dist/esm/dialect/mysql/mysql-dialect-config.d.ts +4 -0
- package/dist/esm/dialect/mysql/mysql-driver.js +3 -0
- package/dist/esm/dialect/postgres/postgres-adapter.d.ts +11 -2
- package/dist/esm/dialect/postgres/postgres-dialect-config.d.ts +10 -3
- package/dist/esm/dialect/postgres/postgres-driver.js +3 -0
- package/dist/esm/dialect/postgres/postgres-introspector.js +5 -1
- package/dist/esm/dialect/sqlite/sqlite-adapter.d.ts +11 -2
- package/dist/esm/dialect/sqlite/sqlite-introspector.js +66 -44
- package/dist/esm/driver/dummy-driver.d.ts +13 -12
- package/dist/esm/driver/dummy-driver.js +13 -12
- package/dist/esm/dynamic/dynamic.d.ts +6 -6
- package/dist/esm/dynamic/dynamic.js +6 -6
- package/dist/esm/expression/expression-builder.d.ts +154 -61
- package/dist/esm/expression/expression-wrapper.d.ts +92 -23
- package/dist/esm/expression/expression.d.ts +40 -5
- package/dist/esm/helpers/mssql.d.ts +74 -14
- package/dist/esm/helpers/mssql.js +74 -14
- package/dist/esm/helpers/mysql.d.ts +14 -10
- package/dist/esm/helpers/mysql.js +14 -10
- package/dist/esm/helpers/postgres.d.ts +7 -4
- package/dist/esm/helpers/postgres.js +7 -4
- package/dist/esm/helpers/sqlite.d.ts +41 -16
- package/dist/esm/helpers/sqlite.js +41 -16
- package/dist/esm/kysely.d.ts +99 -41
- package/dist/esm/kysely.js +60 -36
- package/dist/esm/migration/file-migration-provider.d.ts +2 -2
- package/dist/esm/migration/file-migration-provider.js +2 -2
- package/dist/esm/migration/migrator.d.ts +90 -15
- package/dist/esm/migration/migrator.js +95 -17
- package/dist/esm/operation-node/aggregate-function-node.d.ts +4 -0
- package/dist/esm/operation-node/aggregate-function-node.js +9 -0
- package/dist/esm/operation-node/data-type-node.d.ts +1 -1
- package/dist/esm/operation-node/data-type-node.js +12 -0
- package/dist/esm/operation-node/delete-query-node.d.ts +1 -0
- package/dist/esm/operation-node/insert-query-node.d.ts +1 -0
- package/dist/esm/operation-node/merge-query-node.d.ts +1 -0
- package/dist/esm/operation-node/operation-node-transformer.d.ts +9 -3
- package/dist/esm/operation-node/operation-node-transformer.js +14 -3
- package/dist/esm/operation-node/query-node.d.ts +4 -0
- package/dist/esm/operation-node/query-node.js +8 -0
- package/dist/esm/operation-node/select-query-node.d.ts +0 -1
- package/dist/esm/operation-node/select-query-node.js +0 -8
- package/dist/esm/operation-node/update-query-node.d.ts +1 -0
- package/dist/esm/parser/insert-values-parser.js +3 -1
- package/dist/esm/plugin/camel-case/camel-case-plugin.d.ts +52 -25
- package/dist/esm/plugin/camel-case/camel-case-plugin.js +24 -19
- package/dist/esm/plugin/camel-case/camel-case.js +4 -1
- package/dist/esm/plugin/deduplicate-joins/deduplicate-joins-plugin.d.ts +29 -7
- package/dist/esm/plugin/deduplicate-joins/deduplicate-joins-plugin.js +1 -1
- package/dist/esm/plugin/deduplicate-joins/deduplicate-joins-transformer.js +2 -2
- package/dist/esm/plugin/immediate-value/immediate-value-plugin.d.ts +28 -6
- package/dist/esm/plugin/kysely-plugin.d.ts +28 -6
- package/dist/esm/plugin/noop-plugin.d.ts +28 -6
- package/dist/esm/plugin/parse-json-results/parse-json-results-plugin.d.ts +62 -9
- package/dist/esm/plugin/parse-json-results/parse-json-results-plugin.js +34 -3
- package/dist/esm/plugin/with-schema/with-schema-plugin.d.ts +28 -6
- package/dist/esm/plugin/with-schema/with-schema-transformer.d.ts +4 -0
- package/dist/esm/plugin/with-schema/with-schema-transformer.js +26 -0
- package/dist/esm/query-builder/aggregate-function-builder.d.ts +43 -1
- package/dist/esm/query-builder/aggregate-function-builder.js +30 -0
- package/dist/esm/query-builder/delete-query-builder.d.ts +137 -45
- package/dist/esm/query-builder/delete-query-builder.js +76 -26
- package/dist/esm/query-builder/function-module.d.ts +35 -88
- package/dist/esm/query-builder/insert-query-builder.d.ts +239 -65
- package/dist/esm/query-builder/insert-query-builder.js +188 -52
- package/dist/esm/query-builder/insert-result.d.ts +10 -5
- package/dist/esm/query-builder/insert-result.js +10 -5
- package/dist/esm/query-builder/json-path-builder.d.ts +33 -9
- package/dist/esm/query-builder/json-path-builder.js +8 -5
- package/dist/esm/query-builder/merge-query-builder.d.ts +159 -21
- package/dist/esm/query-builder/merge-query-builder.js +68 -6
- package/dist/esm/query-builder/on-conflict-builder.d.ts +51 -18
- package/dist/esm/query-builder/on-conflict-builder.js +41 -16
- package/dist/esm/query-builder/output-interface.d.ts +50 -7
- package/dist/esm/query-builder/returning-interface.d.ts +5 -5
- package/dist/esm/query-builder/select-query-builder-expression.d.ts +8 -0
- package/dist/esm/query-builder/select-query-builder.d.ts +295 -63
- package/dist/esm/query-builder/select-query-builder.js +7 -7
- package/dist/esm/query-builder/update-query-builder.d.ts +138 -29
- package/dist/esm/query-builder/update-query-builder.js +75 -10
- package/dist/esm/query-builder/update-result.d.ts +2 -2
- package/dist/esm/query-builder/update-result.js +2 -2
- package/dist/esm/query-builder/where-interface.d.ts +5 -1
- package/dist/esm/query-compiler/default-query-compiler.js +20 -0
- package/dist/esm/query-creator.d.ts +66 -18
- package/dist/esm/query-creator.js +2 -2
- package/dist/esm/raw-builder/raw-builder.d.ts +29 -7
- package/dist/esm/raw-builder/sql.d.ts +27 -8
- package/dist/esm/schema/alter-column-builder.d.ts +17 -3
- package/dist/esm/schema/alter-column-builder.js +17 -3
- package/dist/esm/schema/alter-table-add-index-builder.d.ts +43 -9
- package/dist/esm/schema/alter-table-add-index-builder.js +26 -9
- package/dist/esm/schema/column-definition-builder.d.ts +283 -26
- package/dist/esm/schema/column-definition-builder.js +283 -26
- package/dist/esm/schema/create-table-builder.d.ts +86 -33
- package/dist/esm/schema/create-table-builder.js +86 -33
- package/dist/esm/util/column-type.d.ts +5 -9
- package/dist/esm/util/require-all-props.d.ts +4 -2
- package/dist/esm/util/require-all-props.js +4 -2
- package/dist/esm/util/streamable.d.ts +1 -1
- package/dist/esm/util/type-utils.d.ts +4 -2
- package/package.json +28 -23
package/.renovaterc.json
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# ~~Contributor Covenant Code of Conduct~~ Kysely Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
~~We as members, contributors, and leaders pledge to make participation in our~~
|
|
6
|
+
~~community a harassment-free experience for everyone, regardless of age, body~~
|
|
7
|
+
~~size, visible or invisible disability, ethnicity, sex characteristics, gender~~
|
|
8
|
+
~~identity and expression, level of experience, education, socio-economic status,~~
|
|
9
|
+
~~nationality, personal appearance, race, religion, or sexual identity~~
|
|
10
|
+
~~and orientation.~~
|
|
11
|
+
|
|
12
|
+
~~We pledge to act and interact in ways that contribute to an open, welcoming,~~
|
|
13
|
+
~~diverse, inclusive, and healthy community.~~
|
|
14
|
+
|
|
15
|
+
Don't be an asshole.
|
|
16
|
+
You are not entitled to other people's time, energy, or attention.
|
|
17
|
+
|
|
18
|
+
That's it. That's the pledge.
|
|
19
|
+
|
|
20
|
+
## Our Standards
|
|
21
|
+
|
|
22
|
+
~~Examples of behavior that contributes to a positive environment for our~~
|
|
23
|
+
~~community include:~~
|
|
24
|
+
|
|
25
|
+
~~* Demonstrating empathy and kindness toward other people~~
|
|
26
|
+
~~* Being respectful of differing opinions, viewpoints, and experiences~~
|
|
27
|
+
~~* Giving and gracefully accepting constructive feedback~~
|
|
28
|
+
~~* Accepting responsibility and apologizing to those affected by our mistakes,~~
|
|
29
|
+
~~and learning from the experience~~
|
|
30
|
+
~~* Focusing on what is best not just for us as individuals, but for the~~
|
|
31
|
+
~~overall community~~
|
|
32
|
+
|
|
33
|
+
~~Examples of unacceptable behavior include:~~
|
|
34
|
+
|
|
35
|
+
~~* The use of sexualized language or imagery, and sexual attention or~~
|
|
36
|
+
~~advances of any kind~~
|
|
37
|
+
~~* Trolling, insulting or derogatory comments, and personal or political attacks~~
|
|
38
|
+
~~* Public or private harassment~~
|
|
39
|
+
~~* Publishing others' private information, such as a physical or email~~
|
|
40
|
+
~~address, without their explicit permission~~
|
|
41
|
+
~~* Other conduct which could reasonably be considered inappropriate in a~~
|
|
42
|
+
~~professional setting~~
|
|
43
|
+
|
|
44
|
+
Don't be an asshole.
|
|
45
|
+
You are not entitled to other people's time, energy, or attention.
|
|
46
|
+
|
|
47
|
+
Examples of being an asshole or entitled include:
|
|
48
|
+
|
|
49
|
+
* Probably not the best idea to come in complaining and not having minimal respect to develop some basic sentences.
|
|
50
|
+
> what is the migration_lock ?? why we have this in the database - https://github.com/kysely-org/kysely/issues/973
|
|
51
|
+
* Probably not the best idea to attack the maintainer after he answered succinctly (out of character) for whatever reason (context switch? busy?).
|
|
52
|
+
> You got any more of them there examples buster? - https://github.com/kysely-org/kysely/issues/677#issuecomment-2019876074
|
|
53
|
+
* Probably not the best idea to come in all yelling and demanding stuff.
|
|
54
|
+
> NO documentation about error handling!!!!
|
|
55
|
+
> I am really confused that the docs doesnt have anything about error handling
|
|
56
|
+
> this is a mandataory things to add!! - https://github.com/kysely-org/kysely/issues/1217
|
|
57
|
+
* Probably not the best idea to tone police the maintainer after he spent time explaining library philosophy, and to publicly refuse to contribute something you demanded.
|
|
58
|
+
> I'm sorry fella but with your tone I really don't feel like it. Good luck - https://github.com/kysely-org/kysely/issues/709#issuecomment-1727617260
|
|
59
|
+
* Probably not the best idea to question the maintainer's decisions after properly answering your question, and to be entitled for JavaScript skill issue help after the issue is closed.
|
|
60
|
+
> I don't understand your answer and closing the issue. - https://github.com/kysely-org/kysely/issues/527#issuecomment-1577383794
|
|
61
|
+
* Probably not the best idea to jump into closed issues and be entitled to other people's efforts.
|
|
62
|
+
> why on earth there is no mention of this in the documentation? - https://github.com/kysely-org/kysely/issues/649#issuecomment-2430854835
|
|
63
|
+
* Probably not the best idea to not search existing issues, and then ask the maintainer to spend time doing it.
|
|
64
|
+
> could you please provide numbers of duplicated issues to explore the topic? - https://github.com/kysely-org/kysely/issues/762#issuecomment-1801951960
|
|
65
|
+
* Probably not the best idea to sarcastically suggest the maintainer is not helpful while using his hard work for free.
|
|
66
|
+
> Most helpful man in the world - https://github.com/kysely-org/kysely/issues/762#issuecomment-2404599281
|
|
67
|
+
* Probably not the best idea to side with the asshole/entitled by upvoting them or downvoting us.
|
|
68
|
+
|
|
69
|
+

|
|
70
|
+

|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## Enforcement Responsibilities
|
|
75
|
+
|
|
76
|
+
~~Community leaders are responsible for clarifying and enforcing our standards of~~
|
|
77
|
+
~~acceptable behavior and will take appropriate and fair corrective action in~~
|
|
78
|
+
~~response to any behavior that they deem inappropriate, threatening, offensive,~~
|
|
79
|
+
~~or harmful.~~
|
|
80
|
+
|
|
81
|
+
~~Community leaders have the right and responsibility to remove, edit, or reject~~
|
|
82
|
+
~~comments, commits, code, wiki edits, issues, and other contributions that are~~
|
|
83
|
+
~~not aligned to this Code of Conduct, and will communicate reasons for moderation~~
|
|
84
|
+
~~decisions when appropriate.~~
|
|
85
|
+
|
|
86
|
+
We are here in our free time. We are not getting paid to serve and please you.
|
|
87
|
+
|
|
88
|
+
We will not tolerate assholes or entitled behavior.
|
|
89
|
+
|
|
90
|
+
We are capable of banning you from the GitHub organization, Discord server, or any
|
|
91
|
+
other community space we manage. Don't make us do it.
|
|
92
|
+
|
|
93
|
+
## Scope
|
|
94
|
+
|
|
95
|
+
~~This Code of Conduct applies within all community spaces, and also applies when~~
|
|
96
|
+
~~an individual is officially representing the community in public spaces.~~
|
|
97
|
+
~~Examples of representing our community include using an official e-mail address,~~
|
|
98
|
+
~~posting via an official social media account, or acting as an appointed~~
|
|
99
|
+
~~representative at an online or offline event.~~
|
|
100
|
+
|
|
101
|
+
Relevant to all repositories in the Kysely GitHub organization, the Kysely Discord
|
|
102
|
+
server, and any other community space managed by Kysely.
|
|
103
|
+
|
|
104
|
+
## Enforcement
|
|
105
|
+
|
|
106
|
+
~~Instances of abusive, harassing, or otherwise unacceptable behavior may be~~
|
|
107
|
+
~~reported to the community leaders responsible for enforcement at~~
|
|
108
|
+
~~Kysely's GitHub repositories and Discord server.~~
|
|
109
|
+
~~All complaints will be reviewed and investigated promptly and fairly.~~
|
|
110
|
+
|
|
111
|
+
~~All community leaders are obligated to respect the privacy and security of the~~
|
|
112
|
+
~~reporter of any incident.~~
|
|
113
|
+
|
|
114
|
+
Report to us anyone who is being an asshole or entitled.
|
|
115
|
+
We will take appropriate action if necessary.
|
|
116
|
+
|
|
117
|
+
## Enforcement Guidelines
|
|
118
|
+
|
|
119
|
+
~~Community leaders will follow these Community Impact Guidelines in determining~~
|
|
120
|
+
~~the consequences for any action they deem in violation of this Code of Conduct:~~
|
|
121
|
+
|
|
122
|
+
We might do these things:
|
|
123
|
+
|
|
124
|
+
~~### 1. Correction~~
|
|
125
|
+
|
|
126
|
+
**Community Impact**: ~~Use of inappropriate language or other behavior deemed~~
|
|
127
|
+
~~unprofessional or unwelcome in the community.~~
|
|
128
|
+
|
|
129
|
+
Someone being an asshole or entitled.
|
|
130
|
+
|
|
131
|
+
**Consequence**: ~~A private, written warning from community leaders, providing~~
|
|
132
|
+
~~clarity around the nature of the violation and an explanation of why the~~
|
|
133
|
+
~~behavior was inappropriate. A public apology may be requested.~~
|
|
134
|
+
|
|
135
|
+
We might return the favor (we're not perfect), ignore you, edit/close/lock/delete
|
|
136
|
+
your post/comment, or ban you. There is no strike system.
|
|
137
|
+
|
|
138
|
+
~~### 2. Warning~~
|
|
139
|
+
|
|
140
|
+
~~**Community Impact**: A violation through a single incident or series~~
|
|
141
|
+
~~of actions.~~
|
|
142
|
+
|
|
143
|
+
~~**Consequence**: A warning with consequences for continued behavior. No~~
|
|
144
|
+
~~interaction with the people involved, including unsolicited interaction with~~
|
|
145
|
+
~~those enforcing the Code of Conduct, for a specified period of time. This~~
|
|
146
|
+
~~includes avoiding interactions in community spaces as well as external channels~~
|
|
147
|
+
~~like social media. Violating these terms may lead to a temporary or~~
|
|
148
|
+
~~permanent ban.~~
|
|
149
|
+
|
|
150
|
+
~~### 3. Temporary Ban~~
|
|
151
|
+
|
|
152
|
+
~~**Community Impact**: A serious violation of community standards, including~~
|
|
153
|
+
~~sustained inappropriate behavior.~~
|
|
154
|
+
|
|
155
|
+
~~**Consequence**: A temporary ban from any sort of interaction or public~~
|
|
156
|
+
~~communication with the community for a specified period of time. No public or~~
|
|
157
|
+
~~private interaction with the people involved, including unsolicited interaction~~
|
|
158
|
+
~~with those enforcing the Code of Conduct, is allowed during this period.~~
|
|
159
|
+
~~Violating these terms may lead to a permanent ban.~~
|
|
160
|
+
|
|
161
|
+
~~### 4. Permanent Ban~~
|
|
162
|
+
|
|
163
|
+
~~**Community Impact**: Demonstrating a pattern of violation of community~~
|
|
164
|
+
~~standards, including sustained inappropriate behavior, harassment of an~~
|
|
165
|
+
~~individual, or aggression toward or disparagement of classes of individuals.~~
|
|
166
|
+
|
|
167
|
+
~~**Consequence**: A permanent ban from any sort of public interaction within~~
|
|
168
|
+
~~the community.~~
|
|
169
|
+
|
|
170
|
+
## ~~Attribution~~
|
|
171
|
+
|
|
172
|
+
~~This Code of Conduct is adapted from the [Contributor Covenant][homepage],~~
|
|
173
|
+
~~version 2.0, available at~~
|
|
174
|
+
~~https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.~~
|
|
175
|
+
|
|
176
|
+
~~Community Impact Guidelines were inspired by [Mozilla's code of conduct~~
|
|
177
|
+
~~enforcement ladder](https://github.com/mozilla/diversity).~~
|
|
178
|
+
|
|
179
|
+
~~[homepage]: https://www.contributor-covenant.org~~
|
|
180
|
+
|
|
181
|
+
~~For answers to common questions about this code of conduct, see the FAQ at~~
|
|
182
|
+
~~https://www.contributor-covenant.org/faq. Translations are available at~~
|
|
183
|
+
~~https://www.contributor-covenant.org/translations.~~
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,17 +1,115 @@
|
|
|
1
|
-
|
|
1
|
+
# Contribution Guidelines
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Wanna contribute to Kysely or other libraries within the [kysely-org](https://github.com/kysely-org) organization?
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
An issue with a `greenlit` label, has been acknowledged by the team and is ready for development.
|
|
7
|
-
Find such an issue you'd like to tackle and ask to be assigned to it in the comment section.
|
|
8
|
-
Feel free to open an issue if you found a bug or a missing feature you'd like to work on,
|
|
9
|
-
and there aren't any issues mentioning it.
|
|
5
|
+
You're awesome! 🤗
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
an early stage so that we can guide you to the right direction.
|
|
7
|
+
## 😕 How Can I Contribute?
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
## 📢 By Spreading the Word
|
|
10
|
+
|
|
11
|
+
If you like what we're building here, please:
|
|
12
|
+
|
|
13
|
+
1. Tell your friends, co-workers, family, neighbors, followers, etc.
|
|
14
|
+
1. Speak about it in meetups and conferences. (if you need help with the presentation, please ask on Discord!).
|
|
15
|
+
|
|
16
|
+
There is no company behind this organization and project. We do this in our free time and cannot advertise it
|
|
17
|
+
all by ourselves. Companies have dedicated devrel teams doing all that work, other projects might have community
|
|
18
|
+
managers or full-time developers with the capacity to also handle social media and meetups with higher frequency.
|
|
19
|
+
|
|
20
|
+
More people using Kysely eventually means:
|
|
21
|
+
|
|
22
|
+
1. less bugs left unreported and unsolved.
|
|
23
|
+
1. high chance people share workarounds.
|
|
24
|
+
1. more data points for innovation.
|
|
25
|
+
1. more people who might contribute and push this thing even further.
|
|
26
|
+
1. it becomes a standard part of the Node.js/Bun/Deno developer's toolbox so you'll happily stumble upon it
|
|
27
|
+
in future codebases you'll join, or it'll be easier to get buy-in from co-workers/leadership.
|
|
28
|
+
|
|
29
|
+
## 🤝 By Helping People in Issues or on Discord
|
|
30
|
+
|
|
31
|
+
We need all the help we can get with supporting the community, answering questions, triaging!
|
|
32
|
+
|
|
33
|
+
If you've been using the library for a while, or know a thing or two about SQL, and specific databases, don't
|
|
34
|
+
be shy about it!
|
|
35
|
+
|
|
36
|
+
## 🐛 By Submitting Issues (Bugs, Enhancement Ideas, Questions) or Opening threads on Discord
|
|
37
|
+
|
|
38
|
+
Please use search and make sure an existing **open** issue or thread doesn't exist before submitting. If an existing
|
|
39
|
+
issue is only somewhat relevant, please submit a new issue and reference the old one instead of commenting
|
|
40
|
+
on the existing one. Let us label your new issue as `duplicate` if it is the same thing - it's fine! If it's not
|
|
41
|
+
the same thing and you commented on another issue, it makes it harder to track on our end.
|
|
42
|
+
|
|
43
|
+
If possible/relevant, please provide a [playground link](https://kyse.link), Stackblitz OR a public git repository that
|
|
44
|
+
reproduces the issue.
|
|
45
|
+
|
|
46
|
+
Please provide the exact error/warning texts you're getting. "this doesn't work" or "this throws an error"
|
|
47
|
+
are not helping us help you.
|
|
48
|
+
|
|
49
|
+
Don't be an asshole. Don't demand support/service from us.
|
|
50
|
+
|
|
51
|
+
## ⌨️ With Code!
|
|
52
|
+
|
|
53
|
+
### 📘 Documentation Code Contributions
|
|
54
|
+
|
|
55
|
+
Pull requests are always welcome!
|
|
56
|
+
|
|
57
|
+
The [kysely.dev](https://kysely.dev) application is located @ [/site](https://github.com/kysely-org/kysely/tree/master/site).
|
|
58
|
+
|
|
59
|
+
It is a pretty standard [docusaurus](https://docusaurus.io/) application.
|
|
60
|
+
|
|
61
|
+
The code examples are extracted, using a custom script (see `"script:generate-site-examples"` @ [package.json](https://github.com/kysely-org/kysely/blob/master/package.json)),
|
|
62
|
+
and custom annotations, from [JSDocs](https://jsdoc.app/) comments in the source code @ [/src](https://github.com/kysely-org/kysely/tree/master/src).
|
|
63
|
+
If you need to change an existing code example, please do so in the source code AND then run the script.
|
|
64
|
+
_TODO: explain how to add a new code example._
|
|
65
|
+
|
|
66
|
+
If it is a big change (lots of lines of code OR files involved), please get a conversation going on an issue or on
|
|
67
|
+
Discord before starting work on it.
|
|
68
|
+
|
|
69
|
+
### 🧙 Implementation Code Contributions (Bugfixes, Enhancements [Existing or New Features])
|
|
70
|
+
|
|
71
|
+
Pull requests (PRs) are welcome, BUT since:
|
|
72
|
+
|
|
73
|
+
1. Our time and capacity as maintainers are limited.
|
|
74
|
+
1. Your time is limited.
|
|
75
|
+
1. Your motivation and morale is important to us.
|
|
76
|
+
1. Onboarding in a new highly opinionated open-source project can be challenging.
|
|
77
|
+
|
|
78
|
+
We need a process in place:
|
|
79
|
+
|
|
80
|
+
1. To make sure only things that have a good chance of being accepted are worked on. We hate saying "no".
|
|
81
|
+
1. To make sure that things that are being worked on don't result in too much back-and-forth between authors and maintainers.
|
|
82
|
+
We hate seeing these things drag on for a long time, and we know how frustrating it is on your end.
|
|
83
|
+
1. To make sure there's no pressure on you when you take on a task.
|
|
84
|
+
1. To make sure there's a clear understanding of who is working on what to avoid redundancies and conflicts.
|
|
85
|
+
|
|
86
|
+
#### The Process
|
|
87
|
+
|
|
88
|
+
Here is the gist of it:
|
|
89
|
+
|
|
90
|
+
1. If an issue on the subject **doesn't exist** yet, **submit** one. If you want to work on it, **ask** to be **assigned**
|
|
91
|
+
to it in the issue **description**, in the **comments**, OR on **Discord**.
|
|
92
|
+
1. If an issue on the subject **exists** and is labeled with `bug` OR (`enhancement` AND `greenlit`\* OR even `good first issue`\**):
|
|
93
|
+
1. If there is a pull request (**PR**) **linked** to it:
|
|
94
|
+
1. If the **PR** is **stale** (a few months without new commits or comments from the PR author OR Kysely maintainers),
|
|
95
|
+
**ask** to be **assigned** to it and continue work on the PR.
|
|
96
|
+
1. If the **PR** is **not stale**, you can still offer some review comments, or **ask** to **pair** up with the PR author.
|
|
97
|
+
1. If there is **no PR linked** to it and a person is **already assigned** to it:
|
|
98
|
+
1. If the assignment is stale (a few weeks without a PR opened after the person was assigned to the issue), ask
|
|
99
|
+
to be assigned to the issue in the comments OR on Discord.
|
|
100
|
+
1. If the assignment is not stale, it's OK to ask the assignee if they'll be willing to pair up.
|
|
101
|
+
1. If there is no PR linked to it and no assignee, ask to be assigned to it in the comments OR on Discord.
|
|
102
|
+
|
|
103
|
+
_\* an issue that was reviewed by the maintainers and would be nice to get a pull request for from the community._
|
|
104
|
+
|
|
105
|
+
_\** an issue that was reviewed by the maintainers and would be a nice opportunity to onboard an open-source newbie
|
|
106
|
+
into the codebase._
|
|
107
|
+
|
|
108
|
+
Once you're assigned to an issue, you can start working on your code changes. It's best to ask questions
|
|
109
|
+
in the issue or on Discord as early as possible, and even share your progress with the maintainers and community via a
|
|
110
|
+
draft (WIP) pull request.
|
|
111
|
+
|
|
112
|
+
#### Style/Design Philosophy
|
|
15
113
|
|
|
16
114
|
* Kysely should have zero dependencies.
|
|
17
115
|
|
|
@@ -40,31 +138,31 @@ for all cases, are best left for consumers to implement.
|
|
|
40
138
|
|
|
41
139
|
* Most features should have escape hatches.
|
|
42
140
|
|
|
43
|
-
|
|
141
|
+
#### Getting Started
|
|
44
142
|
|
|
45
143
|
1. fork kysely.
|
|
46
144
|
|
|
47
|
-
|
|
145
|
+
1. clone your fork.
|
|
48
146
|
|
|
49
|
-
|
|
147
|
+
1. install node.js (preferably the latest even-numbered version).
|
|
50
148
|
|
|
51
|
-
|
|
149
|
+
1. run `npm i` in your terminal to install dependencies.
|
|
52
150
|
|
|
53
|
-
|
|
151
|
+
1. create a branch (we don't care about naming).
|
|
54
152
|
|
|
55
|
-
|
|
153
|
+
1. create a draft pull request. link the relevant issue by referring to it in the
|
|
56
154
|
PR's description. E.g. `closes #123` will link the PR to issue/pull request #123.
|
|
57
155
|
|
|
58
|
-
|
|
156
|
+
1. implement your changes.
|
|
59
157
|
|
|
60
|
-
|
|
158
|
+
#### Testing
|
|
61
159
|
|
|
62
|
-
1. write functionality tests
|
|
160
|
+
1. write functionality tests @ [/test/node](https://github.com/kysely-org/kysely/tree/master/test/node).
|
|
63
161
|
|
|
64
|
-
|
|
162
|
+
1. write typings tests @ [/test/typings](https://github.com/kysely-org/kysely/tree/master/test/typings)
|
|
65
163
|
|
|
66
|
-
|
|
164
|
+
1. install docker.
|
|
67
165
|
|
|
68
|
-
|
|
166
|
+
1. run `docker compose up` in your terminal to spin up database instances.
|
|
69
167
|
|
|
70
|
-
|
|
168
|
+
1. run `npm test` in another terminal to run tests.
|
package/FUNDING.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Funding
|
|
2
|
+
|
|
3
|
+
Kysely is an MIT-licensed open-source project and is completely free to use - and will remain so.
|
|
4
|
+
|
|
5
|
+
Kysely is a labor of love. We do this in our free time.
|
|
6
|
+
|
|
7
|
+
We do not accept donations.
|
|
8
|
+
|
|
9
|
+
- Getting paid for open-source won't make us put more time and effort into open-source.
|
|
10
|
+
We have family, friends, and other hobbies and interests.
|
|
11
|
+
|
|
12
|
+
- We work in the tech industry, full-time, as software developers. We are comfortable as-is.
|
|
13
|
+
|
|
14
|
+
- We don't believe in freelance open-source as a stable source of income for the long term.
|
|
15
|
+
We have mouths to feed, and careers to maintain.
|
|
16
|
+
|
|
17
|
+
- Sponsored projects tend to be affected by big sponsors. We want to keep Kysely away
|
|
18
|
+
from companies' and VCs' opinions and business needs.
|
|
19
|
+
|
|
20
|
+
- Kysely is escapism for us. We don't want it to feel like another job.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Instead of donating to us, we encourage you to support meaningful causes or other open-source projects in need of funding.
|
|
24
|
+
|
|
25
|
+
Thank you for supporting Kysely through your usage, contributions, and feedback.
|
package/README.md
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
[](https://stand-with-ukraine.pp.ua)
|
|
2
2
|
|
|
3
|
-
[](https://github.com/kysely-org/kysely/releases/latest)
|
|
4
4
|
[](https://github.com/kysely-org/kysely)
|
|
5
5
|
[](https://github.com/kysely-org/kysely/blob/master/LICENSE)
|
|
6
6
|
[](https://github.com/kysely-org/kysely/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
|
|
7
7
|
[](https://github.com/kysely-org/kysely/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc)
|
|
8
|
+

|
|
8
9
|
[](https://www.npmjs.com/package/kysely)
|
|
9
10
|
[](https://bundlephobia.com/package/kysely)
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
###### Join the discussion ⠀⠀⠀⠀⠀⠀⠀
|
|
13
|
+
[](https://discord.gg/xyBJ3GwvAm)
|
|
14
|
+
[](https://bsky.app/profile/kysely.dev)
|
|
15
|
+
|
|
16
|
+
###### Get started
|
|
17
|
+
[](https://kysely.dev/docs/getting-started?dialect=postgresql)
|
|
18
|
+
[](https://kysely.dev/docs/getting-started?dialect=mysql)
|
|
19
|
+
[](https://kysely.dev/docs/getting-started?dialect=mssql)
|
|
20
|
+
[](https://kysely.dev/docs/getting-started?dialect=sqlite)
|
|
21
|
+
& more!
|
|
11
22
|
|
|
12
23
|
# [Kysely](https://kysely.dev)
|
|
13
24
|
|
package/deno.check.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ColumnType,
|
|
3
|
+
Generated,
|
|
4
|
+
GeneratedAlways,
|
|
5
|
+
Insertable,
|
|
6
|
+
Kysely,
|
|
7
|
+
Selectable,
|
|
8
|
+
SqlBool,
|
|
9
|
+
Updateable,
|
|
10
|
+
} from './dist/esm'
|
|
11
|
+
|
|
12
|
+
export interface Database {
|
|
13
|
+
person: PersonTable
|
|
14
|
+
pet: PetTable
|
|
15
|
+
toy: ToyTable
|
|
16
|
+
wine: WineTable
|
|
17
|
+
wine_stock_change: WineStockChangeTable
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface PersonTable {
|
|
21
|
+
id: Generated<number>
|
|
22
|
+
address: { city: string } | null
|
|
23
|
+
age: number | null
|
|
24
|
+
birthdate: ColumnType<Date | null, string | null | undefined, string | null>
|
|
25
|
+
created_at: GeneratedAlways<Date>
|
|
26
|
+
deleted_at: ColumnType<Date | null, string | null | undefined, string | null>
|
|
27
|
+
experience: { role: string }[] | null
|
|
28
|
+
first_name: string
|
|
29
|
+
gender: 'male' | 'female' | 'other' | null
|
|
30
|
+
has_pets: Generated<'Y' | 'N'>
|
|
31
|
+
last_name: string | null
|
|
32
|
+
middle_name: string | null
|
|
33
|
+
nicknames: string[] | null
|
|
34
|
+
nullable_column: string | null
|
|
35
|
+
profile: {
|
|
36
|
+
addresses: { city: string }[]
|
|
37
|
+
website: { url: string }
|
|
38
|
+
} | null
|
|
39
|
+
updated_at: ColumnType<Date | null, string | null | undefined, string | null>
|
|
40
|
+
marital_status: 'single' | 'married' | 'divorced' | 'widowed' | null
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface PetTable {
|
|
44
|
+
id: Generated<number>
|
|
45
|
+
created_at: GeneratedAlways<Date>
|
|
46
|
+
is_favorite: Generated<SqlBool>
|
|
47
|
+
name: string
|
|
48
|
+
owner_id: number
|
|
49
|
+
species: Species
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface ToyTable {
|
|
53
|
+
id: Generated<number>
|
|
54
|
+
pet_id: number
|
|
55
|
+
price: number
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface WineTable {
|
|
59
|
+
name: string
|
|
60
|
+
stock: number
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface WineStockChangeTable {
|
|
64
|
+
stock_delta: number
|
|
65
|
+
wine_name: string
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type Person = Selectable<PersonTable>
|
|
69
|
+
export type NewPerson = Insertable<PersonTable>
|
|
70
|
+
export type PersonUpdate = Updateable<PersonTable>
|
|
71
|
+
export type Pet = Selectable<PetTable>
|
|
72
|
+
export type NewPet = Insertable<PetTable>
|
|
73
|
+
export type PetUpdate = Updateable<PetTable>
|
|
74
|
+
export type Species = 'dog' | 'cat' | 'hamster'
|
|
75
|
+
|
|
76
|
+
declare global {
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
export class Buffer {
|
|
79
|
+
static isBuffer(obj: unknown): obj is { length: number }
|
|
80
|
+
static compare(a: Buffer, b: Buffer): number
|
|
81
|
+
}
|
|
82
|
+
export const db: Kysely<Database>
|
|
83
|
+
export function functionThatExpectsPersonWithNonNullValue(
|
|
84
|
+
person: Person & { nullable_column: string },
|
|
85
|
+
): void
|
|
86
|
+
}
|
package/deno.check.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"types": ["./deno.check.d.ts"]
|
|
5
|
+
},
|
|
6
|
+
"imports": {
|
|
7
|
+
"better-sqlite3": "npm:better-sqlite3",
|
|
8
|
+
"kysely": "./dist/esm",
|
|
9
|
+
"kysely/helpers/mssql": "./dist/esm/helpers/mssql.js",
|
|
10
|
+
"kysely/helpers/mysql": "./dist/esm/helpers/mysql.js",
|
|
11
|
+
"kysely/helpers/postgres": "./dist/esm/helpers/postgres.js",
|
|
12
|
+
"kysely/helpers/sqlite": "./dist/esm/helpers/sqlite.js",
|
|
13
|
+
"lodash/snakeCase": "npm:lodash/snakeCase",
|
|
14
|
+
"mysql2": "npm:mysql2",
|
|
15
|
+
"pg": "npm:pg",
|
|
16
|
+
"pg-cursor": "npm:pg-cursor",
|
|
17
|
+
"tarn": "npm:tarn",
|
|
18
|
+
"tedious": "npm:tedious",
|
|
19
|
+
"type-editor": "./deno.check.d.ts"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -47,8 +47,13 @@ export declare abstract class DialectAdapterBase implements DialectAdapter {
|
|
|
47
47
|
* have explicit locks but supports `FOR UPDATE` row locks and transactional DDL:
|
|
48
48
|
*
|
|
49
49
|
* ```ts
|
|
50
|
-
* {
|
|
51
|
-
*
|
|
50
|
+
* import { DialectAdapterBase, type MigrationLockOptions, Kysely } from 'kysely'
|
|
51
|
+
*
|
|
52
|
+
* export class MyAdapter extends DialectAdapterBase {
|
|
53
|
+
* override async acquireMigrationLock(
|
|
54
|
+
* db: Kysely<any>,
|
|
55
|
+
* options: MigrationLockOptions
|
|
56
|
+
* ): Promise<void> {
|
|
52
57
|
* const queryDb = options.lockTableSchema
|
|
53
58
|
* ? db.withSchema(options.lockTableSchema)
|
|
54
59
|
* : db
|
|
@@ -64,6 +69,10 @@ export declare abstract class DialectAdapterBase implements DialectAdapter {
|
|
|
64
69
|
* .forUpdate()
|
|
65
70
|
* .execute()
|
|
66
71
|
* }
|
|
72
|
+
*
|
|
73
|
+
* override async releaseMigrationLock() {
|
|
74
|
+
* // noop
|
|
75
|
+
* }
|
|
67
76
|
* }
|
|
68
77
|
* ```
|
|
69
78
|
*
|
|
@@ -52,8 +52,13 @@ export interface DialectAdapter {
|
|
|
52
52
|
* have explicit locks but supports `FOR UPDATE` row locks and transactional DDL:
|
|
53
53
|
*
|
|
54
54
|
* ```ts
|
|
55
|
-
* {
|
|
56
|
-
*
|
|
55
|
+
* import { DialectAdapterBase, type MigrationLockOptions, Kysely } from 'kysely'
|
|
56
|
+
*
|
|
57
|
+
* export class MyAdapter extends DialectAdapterBase {
|
|
58
|
+
* override async acquireMigrationLock(
|
|
59
|
+
* db: Kysely<any>,
|
|
60
|
+
* options: MigrationLockOptions
|
|
61
|
+
* ): Promise<void> {
|
|
57
62
|
* const queryDb = options.lockTableSchema
|
|
58
63
|
* ? db.withSchema(options.lockTableSchema)
|
|
59
64
|
* : db
|
|
@@ -69,6 +74,10 @@ export interface DialectAdapter {
|
|
|
69
74
|
* .forUpdate()
|
|
70
75
|
* .execute()
|
|
71
76
|
* }
|
|
77
|
+
*
|
|
78
|
+
* override async releaseMigrationLock() {
|
|
79
|
+
* // noop
|
|
80
|
+
* }
|
|
72
81
|
* }
|
|
73
82
|
* ```
|
|
74
83
|
*
|
|
@@ -36,8 +36,13 @@ export declare class MssqlAdapter extends DialectAdapterBase {
|
|
|
36
36
|
* have explicit locks but supports `FOR UPDATE` row locks and transactional DDL:
|
|
37
37
|
*
|
|
38
38
|
* ```ts
|
|
39
|
-
* {
|
|
40
|
-
*
|
|
39
|
+
* import { DialectAdapterBase, type MigrationLockOptions, Kysely } from 'kysely'
|
|
40
|
+
*
|
|
41
|
+
* export class MyAdapter extends DialectAdapterBase {
|
|
42
|
+
* override async acquireMigrationLock(
|
|
43
|
+
* db: Kysely<any>,
|
|
44
|
+
* options: MigrationLockOptions
|
|
45
|
+
* ): Promise<void> {
|
|
41
46
|
* const queryDb = options.lockTableSchema
|
|
42
47
|
* ? db.withSchema(options.lockTableSchema)
|
|
43
48
|
* : db
|
|
@@ -53,6 +58,10 @@ export declare class MssqlAdapter extends DialectAdapterBase {
|
|
|
53
58
|
* .forUpdate()
|
|
54
59
|
* .execute()
|
|
55
60
|
* }
|
|
61
|
+
*
|
|
62
|
+
* override async releaseMigrationLock() {
|
|
63
|
+
* // noop
|
|
64
|
+
* }
|
|
56
65
|
* }
|
|
57
66
|
* ```
|
|
58
67
|
*
|