@goodie-ts/kysely 0.7.0 → 2.0.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 +18 -2
- package/dist/abstract-migration.d.ts +2 -2
- package/dist/abstract-migration.js +2 -2
- package/dist/components.json +1854 -0
- package/dist/decorators/migration.d.ts +1 -1
- package/dist/decorators/migration.js +1 -1
- package/dist/dialect.d.ts +4 -18
- package/dist/dialect.d.ts.map +1 -1
- package/dist/dialect.js +5 -27
- package/dist/dialect.js.map +1 -1
- package/dist/dialects/d1.d.ts +23 -0
- package/dist/dialects/d1.d.ts.map +1 -0
- package/dist/dialects/d1.js +126 -0
- package/dist/dialects/d1.js.map +1 -0
- package/dist/dialects/index.d.ts +8 -0
- package/dist/dialects/index.d.ts.map +1 -0
- package/dist/dialects/index.js +8 -0
- package/dist/dialects/index.js.map +1 -0
- package/dist/dialects/libsql.d.ts +19 -0
- package/dist/dialects/libsql.d.ts.map +1 -0
- package/dist/dialects/libsql.js +129 -0
- package/dist/dialects/libsql.js.map +1 -0
- package/dist/dialects/mysql.d.ts +24 -0
- package/dist/dialects/mysql.d.ts.map +1 -0
- package/dist/dialects/mysql.js +141 -0
- package/dist/dialects/mysql.js.map +1 -0
- package/dist/dialects/neon.d.ts +17 -0
- package/dist/dialects/neon.d.ts.map +1 -0
- package/dist/dialects/neon.js +126 -0
- package/dist/dialects/neon.js.map +1 -0
- package/dist/dialects/planetscale.d.ts +20 -0
- package/dist/dialects/planetscale.d.ts.map +1 -0
- package/dist/dialects/planetscale.js +132 -0
- package/dist/dialects/planetscale.js.map +1 -0
- package/dist/dialects/postgres.d.ts +30 -0
- package/dist/dialects/postgres.d.ts.map +1 -0
- package/dist/dialects/postgres.js +148 -0
- package/dist/dialects/postgres.js.map +1 -0
- package/dist/dialects/sqlite.d.ts +17 -0
- package/dist/dialects/sqlite.d.ts.map +1 -0
- package/dist/dialects/sqlite.js +126 -0
- package/dist/dialects/sqlite.js.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/kysely-database.d.ts +12 -19
- package/dist/kysely-database.d.ts.map +1 -1
- package/dist/kysely-database.js +7 -87
- package/dist/kysely-database.js.map +1 -1
- package/dist/kysely-transformer-plugin.d.ts +2 -5
- package/dist/kysely-transformer-plugin.d.ts.map +1 -1
- package/dist/kysely-transformer-plugin.js +18 -192
- package/dist/kysely-transformer-plugin.js.map +1 -1
- package/dist/migration-post-processor.d.ts +18 -0
- package/dist/migration-post-processor.d.ts.map +1 -0
- package/dist/migration-post-processor.js +117 -0
- package/dist/migration-post-processor.js.map +1 -0
- package/dist/pool-config.d.ts +12 -0
- package/dist/pool-config.d.ts.map +1 -0
- package/dist/{datasource-config.js → pool-config.js} +9 -57
- package/dist/pool-config.js.map +1 -0
- package/dist/transaction-manager.d.ts +9 -9
- package/dist/transaction-manager.d.ts.map +1 -1
- package/dist/transaction-manager.js +167 -123
- package/dist/transaction-manager.js.map +1 -1
- package/dist/transactional-interceptor.d.ts.map +1 -1
- package/dist/transactional-interceptor.js +68 -17
- package/dist/transactional-interceptor.js.map +1 -1
- package/package.json +23 -8
- package/dist/beans.json +0 -184
- package/dist/datasource-config.d.ts +0 -31
- package/dist/datasource-config.d.ts.map +0 -1
- package/dist/datasource-config.js.map +0 -1
- package/dist/dialect-factory.d.ts +0 -9
- package/dist/dialect-factory.d.ts.map +0 -1
- package/dist/dialect-factory.js +0 -48
- package/dist/dialect-factory.js.map +0 -1
- package/dist/migration-runner.d.ts +0 -16
- package/dist/migration-runner.d.ts.map +0 -1
- package/dist/migration-runner.js +0 -45
- package/dist/migration-runner.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @goodie-ts/kysely
|
|
2
2
|
|
|
3
|
-
[Kysely](https://kysely.dev/) integration for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie) — `KyselyDatabase` library
|
|
3
|
+
[Kysely](https://kysely.dev/) integration for [goodie-ts](https://github.com/GOOD-Code-ApS/goodie) — `KyselyDatabase` library component, declarative transactions, and auto-wired migrations.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -78,6 +78,22 @@ class CreateTodosTable extends AbstractMigration {
|
|
|
78
78
|
|
|
79
79
|
Migrations run automatically at startup via `MigrationRunner` (`@PostConstruct`), sorted by name.
|
|
80
80
|
|
|
81
|
+
## Supported Dialects
|
|
82
|
+
|
|
83
|
+
| Dialect | Driver Package | Edge-Compatible |
|
|
84
|
+
|---------|---------------|-----------------|
|
|
85
|
+
| `postgres` | `pg` | No |
|
|
86
|
+
| `mysql` | `mysql2` | No |
|
|
87
|
+
| `sqlite` | `better-sqlite3` | No |
|
|
88
|
+
| `neon` | `kysely-neon` | Yes |
|
|
89
|
+
| `planetscale` | `kysely-planetscale` | Yes |
|
|
90
|
+
| `libsql` | `@libsql/kysely-libsql` | Yes |
|
|
91
|
+
|
|
92
|
+
Configure via `config/default.json`:
|
|
93
|
+
```json
|
|
94
|
+
{ "datasource": { "url": "postgres://...", "dialect": "postgres" } }
|
|
95
|
+
```
|
|
96
|
+
|
|
81
97
|
## Vite Plugin Setup
|
|
82
98
|
|
|
83
99
|
```typescript
|
|
@@ -93,7 +109,7 @@ export default defineConfig({
|
|
|
93
109
|
});
|
|
94
110
|
```
|
|
95
111
|
|
|
96
|
-
The kysely plugin is auto-discovered — no manual `plugins` configuration needed. `KyselyDatabase` is provided as a library
|
|
112
|
+
The kysely plugin is auto-discovered — no manual `plugins` configuration needed. `KyselyDatabase` is provided as a library component.
|
|
97
113
|
|
|
98
114
|
## License
|
|
99
115
|
|
|
@@ -3,8 +3,8 @@ import type { Kysely } from 'kysely';
|
|
|
3
3
|
* Abstract base class for Kysely migrations.
|
|
4
4
|
*
|
|
5
5
|
* Extend this class and decorate with `@Migration('name')` to define a
|
|
6
|
-
* migration that is auto-discovered and executed by the
|
|
7
|
-
*
|
|
6
|
+
* migration that is auto-discovered and executed by the MigrationPostProcessor
|
|
7
|
+
* when KyselyDatabase is initialized.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Abstract base class for Kysely migrations.
|
|
3
3
|
*
|
|
4
4
|
* Extend this class and decorate with `@Migration('name')` to define a
|
|
5
|
-
* migration that is auto-discovered and executed by the
|
|
6
|
-
*
|
|
5
|
+
* migration that is auto-discovered and executed by the MigrationPostProcessor
|
|
6
|
+
* when KyselyDatabase is initialized.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```typescript
|