kysely 0.15.0 → 0.16.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.
Files changed (60) hide show
  1. package/README.md +12 -24
  2. package/dist/cjs/dialect/database-introspector.d.ts +1 -1
  3. package/dist/cjs/dialect/dialect-adapter-base.d.ts +1 -1
  4. package/dist/cjs/dialect/dialect-adapter.d.ts +1 -1
  5. package/dist/cjs/dialect/dialect.d.ts +2 -2
  6. package/dist/cjs/dialect/mysql/mysql-adapter.d.ts +1 -1
  7. package/dist/cjs/dialect/mysql/mysql-dialect.d.ts +2 -2
  8. package/dist/cjs/dialect/mysql/mysql-introspector.d.ts +1 -1
  9. package/dist/cjs/dialect/postgres/postgres-adapter.d.ts +1 -1
  10. package/dist/cjs/dialect/postgres/postgres-dialect.d.ts +2 -2
  11. package/dist/cjs/dialect/postgres/postgres-introspector.d.ts +1 -1
  12. package/dist/cjs/dialect/sqlite/sqlite-adapter.d.ts +1 -1
  13. package/dist/cjs/dialect/sqlite/sqlite-dialect.d.ts +2 -2
  14. package/dist/cjs/dialect/sqlite/sqlite-introspector.d.ts +1 -1
  15. package/dist/cjs/index-nodeless.d.ts +148 -0
  16. package/dist/cjs/index-nodeless.js +149 -0
  17. package/dist/cjs/index.d.ts +6 -153
  18. package/dist/cjs/index.js +6 -142
  19. package/dist/cjs/kysely.js +9 -5
  20. package/dist/cjs/migration/file-migration-provider.d.ts +2 -25
  21. package/dist/cjs/migration/file-migration-provider.js +8 -17
  22. package/dist/cjs/migration/migrator.d.ts +2 -15
  23. package/dist/cjs/migration/migrator.js +2 -15
  24. package/dist/cjs/parser/join-parser.d.ts +4 -4
  25. package/dist/cjs/query-builder/delete-query-builder.d.ts +5 -4
  26. package/dist/cjs/query-builder/insert-query-builder.d.ts +2 -1
  27. package/dist/cjs/query-builder/join-interface.d.ts +3 -3
  28. package/dist/cjs/query-builder/returning-interface.d.ts +2 -1
  29. package/dist/cjs/query-builder/select-query-builder.d.ts +4 -4
  30. package/dist/cjs/query-builder/update-query-builder.d.ts +5 -4
  31. package/dist/esm/dialect/database-introspector.d.ts +1 -1
  32. package/dist/esm/dialect/dialect-adapter-base.d.ts +1 -1
  33. package/dist/esm/dialect/dialect-adapter.d.ts +1 -1
  34. package/dist/esm/dialect/dialect.d.ts +2 -2
  35. package/dist/esm/dialect/mysql/mysql-adapter.d.ts +1 -1
  36. package/dist/esm/dialect/mysql/mysql-dialect.d.ts +2 -2
  37. package/dist/esm/dialect/mysql/mysql-introspector.d.ts +1 -1
  38. package/dist/esm/dialect/postgres/postgres-adapter.d.ts +1 -1
  39. package/dist/esm/dialect/postgres/postgres-dialect.d.ts +2 -2
  40. package/dist/esm/dialect/postgres/postgres-introspector.d.ts +1 -1
  41. package/dist/esm/dialect/sqlite/sqlite-adapter.d.ts +1 -1
  42. package/dist/esm/dialect/sqlite/sqlite-dialect.d.ts +2 -2
  43. package/dist/esm/dialect/sqlite/sqlite-introspector.d.ts +1 -1
  44. package/dist/esm/index-nodeless.d.ts +148 -0
  45. package/dist/esm/index-nodeless.js +137 -0
  46. package/dist/esm/index.d.ts +6 -153
  47. package/dist/esm/index.js +6 -142
  48. package/dist/esm/kysely.js +9 -5
  49. package/dist/esm/migration/file-migration-provider.d.ts +2 -25
  50. package/dist/esm/migration/file-migration-provider.js +8 -17
  51. package/dist/esm/migration/migrator.d.ts +2 -15
  52. package/dist/esm/migration/migrator.js +2 -15
  53. package/dist/esm/parser/join-parser.d.ts +4 -4
  54. package/dist/esm/query-builder/delete-query-builder.d.ts +5 -4
  55. package/dist/esm/query-builder/insert-query-builder.d.ts +2 -1
  56. package/dist/esm/query-builder/join-interface.d.ts +3 -3
  57. package/dist/esm/query-builder/returning-interface.d.ts +2 -1
  58. package/dist/esm/query-builder/select-query-builder.d.ts +4 -4
  59. package/dist/esm/query-builder/update-query-builder.d.ts +5 -4
  60. package/package.json +4 -2
@@ -1,155 +1,8 @@
1
- export * from './kysely.js';
2
- export * from './query-creator.js';
3
- export * from './query-builder/where-interface.js';
4
- export * from './query-builder/join-interface.js';
5
- export * from './query-builder/returning-interface.js';
6
- export * from './query-builder/having-interface.js';
7
- export * from './query-builder/select-query-builder.js';
8
- export * from './query-builder/insert-query-builder.js';
9
- export * from './query-builder/update-query-builder.js';
10
- export * from './query-builder/delete-query-builder.js';
11
- export * from './query-builder/no-result-error.js';
12
- export * from './query-builder/join-builder.js';
13
- export * from './query-builder/expression-builder.js';
14
- export * from './query-builder/function-builder.js';
15
- export * from './query-builder/insert-result.js';
16
- export * from './query-builder/delete-result.js';
17
- export * from './query-builder/update-result.js';
18
- export * from './query-builder/on-conflict-builder.js';
19
- export * from './raw-builder/raw-builder.js';
20
- export * from './query-executor/query-executor.js';
21
- export * from './query-executor/default-query-executor.js';
22
- export * from './query-executor/noop-query-executor.js';
23
- export * from './query-compiler/default-query-compiler.js';
24
- export * from './query-compiler/compiled-query.js';
25
- export * from './schema/schema.js';
26
- export * from './schema/create-table-builder.js';
27
- export * from './schema/drop-table-builder.js';
28
- export * from './schema/create-index-builder.js';
29
- export * from './schema/drop-index-builder.js';
30
- export * from './schema/create-schema-builder.js';
31
- export * from './schema/drop-schema-builder.js';
32
- export * from './schema/column-definition-builder.js';
33
- export * from './schema/foreign-key-constraint-builder.js';
34
- export * from './schema/alter-table-builder.js';
35
- export * from './schema/create-view-builder.js';
36
- export * from './schema/drop-view-builder.js';
37
- export * from './dynamic/dynamic.js';
38
- export * from './driver/driver.js';
39
- export * from './driver/database-connection.js';
40
- export * from './driver/connection-provider.js';
41
- export * from './driver/default-connection-provider.js';
42
- export * from './driver/single-connection-provider.js';
43
- export * from './dialect/postgres/postgres-dialect.js';
44
- export * from './dialect/postgres/postgres-query-compiler.js';
45
- export * from './dialect/postgres/postgres-driver.js';
46
- export * from './dialect/postgres/postgres-introspector.js';
47
- export * from './dialect/postgres/postgres-adapter.js';
48
- export * from './dialect/mysql/mysql-dialect.js';
49
- export * from './dialect/mysql/mysql-query-compiler.js';
50
- export * from './dialect/mysql/mysql-driver.js';
51
- export * from './dialect/mysql/mysql-introspector.js';
52
- export * from './dialect/mysql/mysql-adapter.js';
1
+ export * from './index-nodeless.js';
2
+ export * from './migration/file-migration-provider.js';
53
3
  export * from './dialect/sqlite/sqlite-dialect.js';
54
- export * from './dialect/sqlite/sqlite-query-compiler.js';
55
4
  export * from './dialect/sqlite/sqlite-driver.js';
56
- export * from './dialect/sqlite/sqlite-introspector.js';
57
- export * from './dialect/sqlite/sqlite-adapter.js';
58
- export * from './query-compiler/default-query-compiler.js';
59
- export * from './query-compiler/query-compiler.js';
60
- export * from './migration/migrator.js';
61
- export * from './migration/file-migration-provider.js';
62
- export * from './dialect/dialect.js';
63
- export * from './dialect/dialect-adapter.js';
64
- export * from './dialect/dialect-adapter-base.js';
65
- export * from './plugin/kysely-plugin.js';
66
- export * from './plugin/camel-case/camel-case-plugin.js';
67
- export * from './operation-node/add-column-node.js';
68
- export * from './operation-node/add-constraint-node.js';
69
- export * from './operation-node/alias-node.js';
70
- export * from './operation-node/alter-column-node.js';
71
- export * from './operation-node/alter-table-node.js';
72
- export * from './operation-node/and-node.js';
73
- export * from './operation-node/check-constraint-node.js';
74
- export * from './operation-node/column-definition-node.js';
75
- export * from './operation-node/column-node.js';
76
- export * from './operation-node/column-update-node.js';
77
- export * from './operation-node/common-table-expression-node.js';
78
- export * from './operation-node/common-table-expression-name-node.js';
79
- export * from './operation-node/constraint-node.js';
80
- export * from './operation-node/create-index-node.js';
81
- export * from './operation-node/create-schema-node.js';
82
- export * from './operation-node/create-table-node.js';
83
- export * from './operation-node/create-view-node.js';
84
- export * from './operation-node/data-type-node.js';
85
- export * from './operation-node/default-value-node.js';
86
- export * from './operation-node/delete-query-node.js';
87
- export * from './operation-node/drop-column-node.js';
88
- export * from './operation-node/drop-constraint-node.js';
89
- export * from './operation-node/drop-index-node.js';
90
- export * from './operation-node/drop-schema-node.js';
91
- export * from './operation-node/drop-table-node.js';
92
- export * from './operation-node/drop-view-node.js';
93
- export * from './operation-node/filter-node.js';
94
- export * from './operation-node/foreign-key-constraint-node.js';
95
- export * from './operation-node/from-node.js';
96
- export * from './operation-node/generated-node.js';
97
- export * from './operation-node/group-by-item-node.js';
98
- export * from './operation-node/group-by-node.js';
99
- export * from './operation-node/having-node.js';
100
- export * from './operation-node/identifier-node.js';
101
- export * from './operation-node/insert-query-node.js';
102
- export * from './operation-node/join-node.js';
103
- export * from './operation-node/limit-node.js';
104
- export * from './operation-node/list-node.js';
105
- export * from './operation-node/modify-column-node.js';
106
- export * from './operation-node/offset-node.js';
107
- export * from './operation-node/on-conflict-node.js';
108
- export * from './operation-node/on-duplicate-key-node.js';
109
- export * from './operation-node/on-node.js';
110
- export * from './operation-node/operation-node-source.js';
111
- export * from './operation-node/operation-node-transformer.js';
112
- export * from './operation-node/operation-node-utils.js';
113
- export * from './operation-node/operation-node-visitor.js';
114
- export * from './operation-node/operation-node.js';
115
- export * from './operation-node/operator-node.js';
116
- export * from './operation-node/or-node.js';
117
- export * from './operation-node/order-by-item-node.js';
118
- export * from './operation-node/order-by-node.js';
119
- export * from './operation-node/parens-node.js';
120
- export * from './operation-node/primary-constraint-node.js';
121
- export * from './operation-node/primitive-value-list-node.js';
122
- export * from './operation-node/query-node.js';
123
- export * from './operation-node/raw-node.js';
124
- export * from './operation-node/reference-node.js';
125
- export * from './operation-node/references-node.js';
126
- export * from './operation-node/rename-column-node.js';
127
- export * from './operation-node/returning-node.js';
128
- export * from './operation-node/select-all-node.js';
129
- export * from './operation-node/select-query-node.js';
130
- export * from './operation-node/select-query-node.js';
131
- export * from './operation-node/selection-node.js';
132
- export * from './operation-node/table-node.js';
133
- export * from './operation-node/union-node.js';
134
- export * from './operation-node/unique-constraint-node.js';
135
- export * from './operation-node/update-query-node.js';
136
- export * from './operation-node/value-list-node.js';
137
- export * from './operation-node/value-node.js';
138
- export * from './operation-node/values-node.js';
139
- export * from './operation-node/where-node.js';
140
- export * from './operation-node/with-node.js';
141
- export * from './dialect/database-introspector.js';
142
- export * from './util/column-type.js';
143
- export * from './util/compilable.js';
144
- export * from './util/log.js';
145
- export { AnyColumn, UnknownRow, AnySelectQueryBuilder, } from './util/type-utils.js';
146
- export { SelectExpression, SelectExpressionOrList, Selection, } from './parser/select-parser.js';
147
- export { ReferenceExpression, ReferenceExpressionOrList, } from './parser/reference-parser.js';
148
- export { ValueExpression, ValueExpressionOrList, } from './parser/value-parser.js';
149
- export { FilterValueExpression, FilterValueExpressionOrList, ExistsExpression, FilterOperator, } from './parser/filter-parser.js';
150
- export { TableExpression, TableExpressionOrList, } from './parser/table-parser.js';
151
- export { JoinReferenceExpression, JoinCallbackExpression, } from './parser/join-parser.js';
152
- export { InsertObject } from './parser/insert-values-parser.js';
153
- export { MutationObject } from './parser/update-set-parser.js';
154
- export { OrderByExpression, OrderByDirectionExpression, } from './parser/order-by-parser.js';
155
- export { UnionExpression } from './parser/union-parser.js';
5
+ export * from './dialect/mysql/mysql-dialect.js';
6
+ export * from './dialect/mysql/mysql-driver.js';
7
+ export * from './dialect/postgres/postgres-driver.js';
8
+ export * from './dialect/postgres/postgres-dialect.js';
package/dist/cjs/index.js CHANGED
@@ -10,147 +10,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./kysely.js"), exports);
14
- __exportStar(require("./query-creator.js"), exports);
15
- __exportStar(require("./query-builder/where-interface.js"), exports);
16
- __exportStar(require("./query-builder/join-interface.js"), exports);
17
- __exportStar(require("./query-builder/returning-interface.js"), exports);
18
- __exportStar(require("./query-builder/having-interface.js"), exports);
19
- __exportStar(require("./query-builder/select-query-builder.js"), exports);
20
- __exportStar(require("./query-builder/insert-query-builder.js"), exports);
21
- __exportStar(require("./query-builder/update-query-builder.js"), exports);
22
- __exportStar(require("./query-builder/delete-query-builder.js"), exports);
23
- __exportStar(require("./query-builder/no-result-error.js"), exports);
24
- __exportStar(require("./query-builder/join-builder.js"), exports);
25
- __exportStar(require("./query-builder/expression-builder.js"), exports);
26
- __exportStar(require("./query-builder/function-builder.js"), exports);
27
- __exportStar(require("./query-builder/insert-result.js"), exports);
28
- __exportStar(require("./query-builder/delete-result.js"), exports);
29
- __exportStar(require("./query-builder/update-result.js"), exports);
30
- __exportStar(require("./query-builder/on-conflict-builder.js"), exports);
31
- __exportStar(require("./raw-builder/raw-builder.js"), exports);
32
- __exportStar(require("./query-executor/query-executor.js"), exports);
33
- __exportStar(require("./query-executor/default-query-executor.js"), exports);
34
- __exportStar(require("./query-executor/noop-query-executor.js"), exports);
35
- __exportStar(require("./query-compiler/default-query-compiler.js"), exports);
36
- __exportStar(require("./query-compiler/compiled-query.js"), exports);
37
- __exportStar(require("./schema/schema.js"), exports);
38
- __exportStar(require("./schema/create-table-builder.js"), exports);
39
- __exportStar(require("./schema/drop-table-builder.js"), exports);
40
- __exportStar(require("./schema/create-index-builder.js"), exports);
41
- __exportStar(require("./schema/drop-index-builder.js"), exports);
42
- __exportStar(require("./schema/create-schema-builder.js"), exports);
43
- __exportStar(require("./schema/drop-schema-builder.js"), exports);
44
- __exportStar(require("./schema/column-definition-builder.js"), exports);
45
- __exportStar(require("./schema/foreign-key-constraint-builder.js"), exports);
46
- __exportStar(require("./schema/alter-table-builder.js"), exports);
47
- __exportStar(require("./schema/create-view-builder.js"), exports);
48
- __exportStar(require("./schema/drop-view-builder.js"), exports);
49
- __exportStar(require("./dynamic/dynamic.js"), exports);
50
- __exportStar(require("./driver/driver.js"), exports);
51
- __exportStar(require("./driver/database-connection.js"), exports);
52
- __exportStar(require("./driver/connection-provider.js"), exports);
53
- __exportStar(require("./driver/default-connection-provider.js"), exports);
54
- __exportStar(require("./driver/single-connection-provider.js"), exports);
55
- __exportStar(require("./dialect/postgres/postgres-dialect.js"), exports);
56
- __exportStar(require("./dialect/postgres/postgres-query-compiler.js"), exports);
57
- __exportStar(require("./dialect/postgres/postgres-driver.js"), exports);
58
- __exportStar(require("./dialect/postgres/postgres-introspector.js"), exports);
59
- __exportStar(require("./dialect/postgres/postgres-adapter.js"), exports);
60
- __exportStar(require("./dialect/mysql/mysql-dialect.js"), exports);
61
- __exportStar(require("./dialect/mysql/mysql-query-compiler.js"), exports);
62
- __exportStar(require("./dialect/mysql/mysql-driver.js"), exports);
63
- __exportStar(require("./dialect/mysql/mysql-introspector.js"), exports);
64
- __exportStar(require("./dialect/mysql/mysql-adapter.js"), exports);
13
+ __exportStar(require("./index-nodeless.js"), exports);
14
+ __exportStar(require("./migration/file-migration-provider.js"), exports);
65
15
  __exportStar(require("./dialect/sqlite/sqlite-dialect.js"), exports);
66
- __exportStar(require("./dialect/sqlite/sqlite-query-compiler.js"), exports);
67
16
  __exportStar(require("./dialect/sqlite/sqlite-driver.js"), exports);
68
- __exportStar(require("./dialect/sqlite/sqlite-introspector.js"), exports);
69
- __exportStar(require("./dialect/sqlite/sqlite-adapter.js"), exports);
70
- __exportStar(require("./query-compiler/default-query-compiler.js"), exports);
71
- __exportStar(require("./query-compiler/query-compiler.js"), exports);
72
- __exportStar(require("./migration/migrator.js"), exports);
73
- __exportStar(require("./migration/file-migration-provider.js"), exports);
74
- __exportStar(require("./dialect/dialect.js"), exports);
75
- __exportStar(require("./dialect/dialect-adapter.js"), exports);
76
- __exportStar(require("./dialect/dialect-adapter-base.js"), exports);
77
- __exportStar(require("./plugin/kysely-plugin.js"), exports);
78
- __exportStar(require("./plugin/camel-case/camel-case-plugin.js"), exports);
79
- __exportStar(require("./operation-node/add-column-node.js"), exports);
80
- __exportStar(require("./operation-node/add-constraint-node.js"), exports);
81
- __exportStar(require("./operation-node/alias-node.js"), exports);
82
- __exportStar(require("./operation-node/alter-column-node.js"), exports);
83
- __exportStar(require("./operation-node/alter-table-node.js"), exports);
84
- __exportStar(require("./operation-node/and-node.js"), exports);
85
- __exportStar(require("./operation-node/check-constraint-node.js"), exports);
86
- __exportStar(require("./operation-node/column-definition-node.js"), exports);
87
- __exportStar(require("./operation-node/column-node.js"), exports);
88
- __exportStar(require("./operation-node/column-update-node.js"), exports);
89
- __exportStar(require("./operation-node/common-table-expression-node.js"), exports);
90
- __exportStar(require("./operation-node/common-table-expression-name-node.js"), exports);
91
- __exportStar(require("./operation-node/constraint-node.js"), exports);
92
- __exportStar(require("./operation-node/create-index-node.js"), exports);
93
- __exportStar(require("./operation-node/create-schema-node.js"), exports);
94
- __exportStar(require("./operation-node/create-table-node.js"), exports);
95
- __exportStar(require("./operation-node/create-view-node.js"), exports);
96
- __exportStar(require("./operation-node/data-type-node.js"), exports);
97
- __exportStar(require("./operation-node/default-value-node.js"), exports);
98
- __exportStar(require("./operation-node/delete-query-node.js"), exports);
99
- __exportStar(require("./operation-node/drop-column-node.js"), exports);
100
- __exportStar(require("./operation-node/drop-constraint-node.js"), exports);
101
- __exportStar(require("./operation-node/drop-index-node.js"), exports);
102
- __exportStar(require("./operation-node/drop-schema-node.js"), exports);
103
- __exportStar(require("./operation-node/drop-table-node.js"), exports);
104
- __exportStar(require("./operation-node/drop-view-node.js"), exports);
105
- __exportStar(require("./operation-node/filter-node.js"), exports);
106
- __exportStar(require("./operation-node/foreign-key-constraint-node.js"), exports);
107
- __exportStar(require("./operation-node/from-node.js"), exports);
108
- __exportStar(require("./operation-node/generated-node.js"), exports);
109
- __exportStar(require("./operation-node/group-by-item-node.js"), exports);
110
- __exportStar(require("./operation-node/group-by-node.js"), exports);
111
- __exportStar(require("./operation-node/having-node.js"), exports);
112
- __exportStar(require("./operation-node/identifier-node.js"), exports);
113
- __exportStar(require("./operation-node/insert-query-node.js"), exports);
114
- __exportStar(require("./operation-node/join-node.js"), exports);
115
- __exportStar(require("./operation-node/limit-node.js"), exports);
116
- __exportStar(require("./operation-node/list-node.js"), exports);
117
- __exportStar(require("./operation-node/modify-column-node.js"), exports);
118
- __exportStar(require("./operation-node/offset-node.js"), exports);
119
- __exportStar(require("./operation-node/on-conflict-node.js"), exports);
120
- __exportStar(require("./operation-node/on-duplicate-key-node.js"), exports);
121
- __exportStar(require("./operation-node/on-node.js"), exports);
122
- __exportStar(require("./operation-node/operation-node-source.js"), exports);
123
- __exportStar(require("./operation-node/operation-node-transformer.js"), exports);
124
- __exportStar(require("./operation-node/operation-node-utils.js"), exports);
125
- __exportStar(require("./operation-node/operation-node-visitor.js"), exports);
126
- __exportStar(require("./operation-node/operation-node.js"), exports);
127
- __exportStar(require("./operation-node/operator-node.js"), exports);
128
- __exportStar(require("./operation-node/or-node.js"), exports);
129
- __exportStar(require("./operation-node/order-by-item-node.js"), exports);
130
- __exportStar(require("./operation-node/order-by-node.js"), exports);
131
- __exportStar(require("./operation-node/parens-node.js"), exports);
132
- __exportStar(require("./operation-node/primary-constraint-node.js"), exports);
133
- __exportStar(require("./operation-node/primitive-value-list-node.js"), exports);
134
- __exportStar(require("./operation-node/query-node.js"), exports);
135
- __exportStar(require("./operation-node/raw-node.js"), exports);
136
- __exportStar(require("./operation-node/reference-node.js"), exports);
137
- __exportStar(require("./operation-node/references-node.js"), exports);
138
- __exportStar(require("./operation-node/rename-column-node.js"), exports);
139
- __exportStar(require("./operation-node/returning-node.js"), exports);
140
- __exportStar(require("./operation-node/select-all-node.js"), exports);
141
- __exportStar(require("./operation-node/select-query-node.js"), exports);
142
- __exportStar(require("./operation-node/select-query-node.js"), exports);
143
- __exportStar(require("./operation-node/selection-node.js"), exports);
144
- __exportStar(require("./operation-node/table-node.js"), exports);
145
- __exportStar(require("./operation-node/union-node.js"), exports);
146
- __exportStar(require("./operation-node/unique-constraint-node.js"), exports);
147
- __exportStar(require("./operation-node/update-query-node.js"), exports);
148
- __exportStar(require("./operation-node/value-list-node.js"), exports);
149
- __exportStar(require("./operation-node/value-node.js"), exports);
150
- __exportStar(require("./operation-node/values-node.js"), exports);
151
- __exportStar(require("./operation-node/where-node.js"), exports);
152
- __exportStar(require("./operation-node/with-node.js"), exports);
153
- __exportStar(require("./dialect/database-introspector.js"), exports);
154
- __exportStar(require("./util/column-type.js"), exports);
155
- __exportStar(require("./util/compilable.js"), exports);
156
- __exportStar(require("./util/log.js"), exports);
17
+ __exportStar(require("./dialect/mysql/mysql-dialect.js"), exports);
18
+ __exportStar(require("./dialect/mysql/mysql-driver.js"), exports);
19
+ __exportStar(require("./dialect/postgres/postgres-driver.js"), exports);
20
+ __exportStar(require("./dialect/postgres/postgres-dialect.js"), exports);
@@ -59,9 +59,11 @@ const private_symbols_js_1 = require("./util/private-symbols.js");
59
59
  class Kysely extends query_creator_js_1.QueryCreator {
60
60
  #props;
61
61
  constructor(args) {
62
+ let superProps;
63
+ let props;
62
64
  if (isKyselyProps(args)) {
63
- super({ executor: args.executor, parseContext: args.parseContext });
64
- this.#props = (0, object_utils_js_1.freeze)({ ...args });
65
+ superProps = { executor: args.executor, parseContext: args.parseContext };
66
+ props = { ...args };
65
67
  }
66
68
  else {
67
69
  const dialect = args.dialect;
@@ -73,15 +75,17 @@ class Kysely extends query_creator_js_1.QueryCreator {
73
75
  const runtimeDriver = new runtime_driver_js_1.RuntimeDriver(driver, log);
74
76
  const connectionProvider = new default_connection_provider_js_1.DefaultConnectionProvider(runtimeDriver);
75
77
  const executor = new default_query_executor_js_1.DefaultQueryExecutor(compiler, connectionProvider, args.plugins ?? []);
76
- super({ executor, parseContext });
77
- this.#props = (0, object_utils_js_1.freeze)({
78
+ superProps = { executor, parseContext };
79
+ props = {
78
80
  config: args,
79
81
  executor,
80
82
  dialect,
81
83
  driver: runtimeDriver,
82
84
  parseContext,
83
- });
85
+ };
84
86
  }
87
+ super(superProps);
88
+ this.#props = (0, object_utils_js_1.freeze)(props);
85
89
  }
86
90
  /**
87
91
  * Returns the {@link SchemaModule} module for building database schema.
@@ -1,41 +1,18 @@
1
1
  import { Migration, MigrationProvider } from './migrator.js';
2
- /**
3
- * A function that takes a folder path and returns names of the
4
- * files insider that folder.
5
- */
6
- export declare type ReadDir = (migrationFolderPath: string) => Promise<string[]>;
7
- /**
8
- * A function that combines two file path parts into a single file path.
9
- *
10
- * ```ts
11
- * joinPath('/some/path', 'file.ts')
12
- * // ==> '/some/path/file.ts'
13
- * ```
14
- */
15
- export declare type JoinPath = (part1: string, part2: string) => string;
16
2
  /**
17
3
  * Reads all migrations from a folder.
18
4
  *
19
- * You need to provide a function for reading files in a folder and a function for
20
- * joining file paths together. The API is like this to make Kysely independent of
21
- * node.js or any other environment. See the example usage on node.js below.
22
- *
23
5
  * ### Examples
24
6
  *
25
7
  * ```ts
26
- * import * as path from 'path'
27
- * import * as fs from 'fs/promises'
28
- *
29
8
  * new FileMigrationProvider(
30
- * fs.readdir,
31
- * path.join,
32
- * path.join(__dirname, 'migrations')
9
+ * 'path/to/migrations/folder'
33
10
  * )
34
11
  * ```
35
12
  */
36
13
  export declare class FileMigrationProvider implements MigrationProvider {
37
14
  #private;
38
- constructor(readDir: ReadDir, joinPath: JoinPath, migrationFolderPath: string);
15
+ constructor(migrationFolderPath: string);
39
16
  /**
40
17
  * Returns all migrations, old and new.
41
18
  *
@@ -5,39 +5,30 @@ const object_utils_js_1 = require("../util/object-utils.js");
5
5
  /**
6
6
  * Reads all migrations from a folder.
7
7
  *
8
- * You need to provide a function for reading files in a folder and a function for
9
- * joining file paths together. The API is like this to make Kysely independent of
10
- * node.js or any other environment. See the example usage on node.js below.
11
- *
12
8
  * ### Examples
13
9
  *
14
10
  * ```ts
15
- * import * as path from 'path'
16
- * import * as fs from 'fs/promises'
17
- *
18
11
  * new FileMigrationProvider(
19
- * fs.readdir,
20
- * path.join,
21
- * path.join(__dirname, 'migrations')
12
+ * 'path/to/migrations/folder'
22
13
  * )
23
14
  * ```
24
15
  */
25
16
  class FileMigrationProvider {
26
- #readDir;
27
- #joinPath;
28
17
  #migrationFolderPath;
29
- constructor(readDir, joinPath, migrationFolderPath) {
30
- this.#readDir = readDir;
31
- this.#joinPath = joinPath;
18
+ constructor(migrationFolderPath) {
32
19
  this.#migrationFolderPath = migrationFolderPath;
33
20
  }
34
21
  async getMigrations() {
22
+ // Import these dynamically so that we don't have any top level
23
+ // node dependencies.
24
+ const fs = await Promise.resolve().then(() => require('fs/promises'));
25
+ const path = await Promise.resolve().then(() => require('path'));
35
26
  const migrations = {};
36
- const files = await this.#readDir(this.#migrationFolderPath);
27
+ const files = await fs.readdir(this.#migrationFolderPath);
37
28
  for (const fileName of files) {
38
29
  if ((fileName.endsWith('.js') || fileName.endsWith('.ts')) &&
39
30
  !fileName.endsWith('.d.ts')) {
40
- const migration = await Promise.resolve().then(() => require(this.#joinPath(this.#migrationFolderPath, fileName)));
31
+ const migration = await Promise.resolve().then(() => require(path.join(this.#migrationFolderPath, fileName)));
41
32
  if (isMigration(migration)) {
42
33
  migrations[fileName.substring(0, fileName.length - 3)] = migration;
43
34
  }
@@ -26,14 +26,9 @@ export interface Migration {
26
26
  * ```ts
27
27
  * const migrator = new Migrator({
28
28
  * db,
29
- * // The constructor signature of FileMigrationProvider is a
30
- * // bit weird to keep Kysely independent of node.js or any
31
- * // other environment.
32
29
  * provider: new FileMigrationProvider(
33
- * fs.readdir,
34
- * path.join,
35
30
  * // Path to the folder that contains all your migrations.
36
- * 'migrations'
31
+ * 'some/path/to/migrations'
37
32
  * )
38
33
  * })
39
34
  * ```
@@ -57,9 +52,6 @@ export declare class Migrator {
57
52
  * ### Examples
58
53
  *
59
54
  * ```ts
60
- * import * as path from 'path'
61
- * import * as fs from 'fs/promises'
62
- *
63
55
  * const db = new Kysely<Database>({
64
56
  * dialect: new PostgresDialect({
65
57
  * host: 'localhost',
@@ -69,14 +61,9 @@ export declare class Migrator {
69
61
  *
70
62
  * const migrator = new Migrator({
71
63
  * db,
72
- * // The constructor signature of FileMigrationProvider is a
73
- * // bit weird to keep Kysely independent of node.js or any
74
- * // other environment.
75
64
  * provider: new FileMigrationProvider(
76
- * fs.readdir,
77
- * path.join,
78
65
  * // Path to the folder that contains all your migrations.
79
- * 'migrations'
66
+ * 'some/path/to/migrations'
80
67
  * )
81
68
  * })
82
69
  *
@@ -20,14 +20,9 @@ exports.NO_MIGRATIONS = (0, object_utils_js_1.freeze)({ __noMigrations__: true }
20
20
  * ```ts
21
21
  * const migrator = new Migrator({
22
22
  * db,
23
- * // The constructor signature of FileMigrationProvider is a
24
- * // bit weird to keep Kysely independent of node.js or any
25
- * // other environment.
26
23
  * provider: new FileMigrationProvider(
27
- * fs.readdir,
28
- * path.join,
29
24
  * // Path to the folder that contains all your migrations.
30
- * 'migrations'
25
+ * 'some/path/to/migrations'
31
26
  * )
32
27
  * })
33
28
  * ```
@@ -53,9 +48,6 @@ class Migrator {
53
48
  * ### Examples
54
49
  *
55
50
  * ```ts
56
- * import * as path from 'path'
57
- * import * as fs from 'fs/promises'
58
- *
59
51
  * const db = new Kysely<Database>({
60
52
  * dialect: new PostgresDialect({
61
53
  * host: 'localhost',
@@ -65,14 +57,9 @@ class Migrator {
65
57
  *
66
58
  * const migrator = new Migrator({
67
59
  * db,
68
- * // The constructor signature of FileMigrationProvider is a
69
- * // bit weird to keep Kysely independent of node.js or any
70
- * // other environment.
71
60
  * provider: new FileMigrationProvider(
72
- * fs.readdir,
73
- * path.join,
74
61
  * // Path to the folder that contains all your migrations.
75
- * 'migrations'
62
+ * 'some/path/to/migrations'
76
63
  * )
77
64
  * })
78
65
  *
@@ -1,11 +1,11 @@
1
1
  import { JoinNode, JoinType } from '../operation-node/join-node.js';
2
2
  import { AnyColumn, AnyColumnWithTable } from '../util/type-utils.js';
3
- import { ExtractAliasFromTableExpression, TableExpressionDatabase } from './table-parser.js';
3
+ import { TableExpressionDatabase, TableExpressionTables } from './table-parser.js';
4
4
  import { JoinBuilder } from '../query-builder/join-builder.js';
5
5
  import { ParseContext } from './parse-context.js';
6
6
  export declare type JoinReferenceExpression<DB, TB extends keyof DB, TE> = AnyJoinColumn<DB, TB, TE> | AnyJoinColumnWithTable<DB, TB, TE>;
7
- export declare type JoinCallbackExpression<DB, TB extends keyof DB, TE> = (join: JoinBuilder<TableExpressionDatabase<DB, TE>, TB | ExtractAliasFromTableExpression<DB, TE>>) => JoinBuilder<any, any>;
8
- declare type AnyJoinColumn<DB, TB extends keyof DB, TE> = AnyColumn<TableExpressionDatabase<DB, TE>, TB | ExtractAliasFromTableExpression<DB, TE>>;
9
- declare type AnyJoinColumnWithTable<DB, TB extends keyof DB, TE> = AnyColumnWithTable<TableExpressionDatabase<DB, TE>, TB | ExtractAliasFromTableExpression<DB, TE>>;
7
+ export declare type JoinCallbackExpression<DB, TB extends keyof DB, TE> = (join: JoinBuilder<TableExpressionDatabase<DB, TE>, TableExpressionTables<DB, TB, TE>>) => JoinBuilder<any, any>;
8
+ declare type AnyJoinColumn<DB, TB extends keyof DB, TE> = AnyColumn<TableExpressionDatabase<DB, TE>, TableExpressionTables<DB, TB, TE>>;
9
+ declare type AnyJoinColumnWithTable<DB, TB extends keyof DB, TE> = AnyColumnWithTable<TableExpressionDatabase<DB, TE>, TableExpressionTables<DB, TB, TE>>;
10
10
  export declare function parseJoin(ctx: ParseContext, joinType: JoinType, args: any[]): JoinNode;
11
11
  export {};
@@ -17,6 +17,7 @@ import { JoinInterface } from './join-interface.js';
17
17
  import { ReturningInterface } from './returning-interface.js';
18
18
  import { NoResultErrorConstructor } from './no-result-error.js';
19
19
  import { DeleteQueryNode } from '../operation-node/delete-query-node.js';
20
+ import { Selectable } from '../util/column-type.js';
20
21
  export declare class DeleteQueryBuilder<DB, TB extends keyof DB, O> implements WhereInterface<DB, TB>, JoinInterface<DB, TB>, ReturningInterface<DB, TB, O>, OperationNodeSource, Compilable {
21
22
  #private;
22
23
  constructor(props: DeleteQueryBuilderProps);
@@ -472,13 +473,13 @@ export declare class DeleteQueryBuilder<DB, TB extends keyof DB, O> implements W
472
473
  * and "pet"."name" = $1
473
474
  * ```
474
475
  *
475
- * You can join a subquery by providing a function as the first
476
- * argument:
476
+ * You can join a subquery by providing a select query (or a callback)
477
+ * as the first argument:
477
478
  *
478
479
  * ```ts
479
480
  * await db.selectFrom('person')
480
481
  * .innerJoin(
481
- * (qb) => qb.selectFrom('pet')
482
+ * qb.selectFrom('pet')
482
483
  * .select(['owner_id', 'name'])
483
484
  * .where('name', '=', 'Doggo')
484
485
  * .as('doggos'),
@@ -584,7 +585,7 @@ export declare class DeleteQueryBuilder<DB, TB extends keyof DB, O> implements W
584
585
  * Adds a `returning *` to an insert/update/delete query on databases
585
586
  * that support `returning` such as PostgreSQL.
586
587
  */
587
- returningAll(): DeleteQueryBuilder<DB, TB, DB[TB]>;
588
+ returningAll(): DeleteQueryBuilder<DB, TB, Selectable<DB[TB]>>;
588
589
  /**
589
590
  * Simply calls the given function passing `this` as the only argument.
590
591
  *
@@ -15,6 +15,7 @@ import { NoResultErrorConstructor } from './no-result-error.js';
15
15
  import { ComplexExpression } from '../parser/complex-expression-parser.js';
16
16
  import { ReturningInterface } from './returning-interface.js';
17
17
  import { OnConflictBuilder, OnConflictDoNothingBuilder, OnConflictUpdateBuilder } from './on-conflict-builder.js';
18
+ import { Selectable } from '../util/column-type.js';
18
19
  export declare class InsertQueryBuilder<DB, TB extends keyof DB, O> implements ReturningInterface<DB, TB, O>, OperationNodeSource, Compilable {
19
20
  #private;
20
21
  constructor(props: InsertQueryBuilderProps);
@@ -427,7 +428,7 @@ export declare class InsertQueryBuilder<DB, TB extends keyof DB, O> implements R
427
428
  * Adds a `returning *` to an insert/update/delete query on databases
428
429
  * that support `returning` such as PostgreSQL.
429
430
  */
430
- returningAll(): InsertQueryBuilder<DB, TB, DB[TB]>;
431
+ returningAll(): InsertQueryBuilder<DB, TB, Selectable<DB[TB]>>;
431
432
  /**
432
433
  * Simply calls the given function passing `this` as the only argument.
433
434
  *
@@ -80,13 +80,13 @@ export interface JoinInterface<DB, TB extends keyof DB> {
80
80
  * and "pet"."name" = $1
81
81
  * ```
82
82
  *
83
- * You can join a subquery by providing a function as the first
84
- * argument:
83
+ * You can join a subquery by providing a select query (or a callback)
84
+ * as the first argument:
85
85
  *
86
86
  * ```ts
87
87
  * await db.selectFrom('person')
88
88
  * .innerJoin(
89
- * (qb) => qb.selectFrom('pet')
89
+ * qb.selectFrom('pet')
90
90
  * .select(['owner_id', 'name'])
91
91
  * .where('name', '=', 'Doggo')
92
92
  * .as('doggos'),
@@ -1,5 +1,6 @@
1
1
  import { ReturningRow } from '../parser/returning-parser.js';
2
2
  import { SelectExpression } from '../parser/select-parser.js';
3
+ import { Selectable } from '../util/column-type.js';
3
4
  export interface ReturningInterface<DB, TB extends keyof DB, O> {
4
5
  /**
5
6
  * Allows you to return data from modified rows.
@@ -66,5 +67,5 @@ export interface ReturningInterface<DB, TB extends keyof DB, O> {
66
67
  * Adds a `returning *` to an insert/update/delete query on databases
67
68
  * that support `returning` such as PostgreSQL.
68
69
  */
69
- returningAll(): ReturningInterface<DB, TB, DB[TB]>;
70
+ returningAll(): ReturningInterface<DB, TB, Selectable<DB[TB]>>;
70
71
  }