@cossackframework/database 0.7.6 → 0.7.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cossackframework/database",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "type": "module",
5
5
  "description": "Database support for the Cossack Framework — Kysely-based query builder with D1 and Turso dialects, migrations, and seeders",
6
6
  "license": "MIT",
@@ -21,6 +21,17 @@ import {
21
21
  } from 'kysely/migration';
22
22
  import type { D1DatabaseLike } from '../types';
23
23
 
24
+ /**
25
+ * Kysely's SQLite behavior with an explicit, duplicate-install-safe D1 brand.
26
+ *
27
+ * Consumers should inspect `cossackDialect` instead of relying on
28
+ * `instanceof` or constructor names, which can change across package copies
29
+ * and build tools.
30
+ */
31
+ export class D1Adapter extends SqliteAdapter {
32
+ readonly cossackDialect = 'd1' as const;
33
+ }
34
+
24
35
  /**
25
36
  * Kysely {@link Dialect} for Cloudflare D1.
26
37
  *
@@ -43,8 +54,8 @@ export class D1Dialect implements Dialect {
43
54
  createQueryCompiler(): SqliteQueryCompiler {
44
55
  return new SqliteQueryCompiler();
45
56
  }
46
- createAdapter(): SqliteAdapter {
47
- return new SqliteAdapter();
57
+ createAdapter(): D1Adapter {
58
+ return new D1Adapter();
48
59
  }
49
60
  createIntrospector(db: Kysely<any>): DatabaseIntrospector {
50
61
  return new D1Introspector(db);
package/src/index.ts CHANGED
@@ -35,7 +35,7 @@ export { DatabaseCacheStore } from './cache-store';
35
35
  export type { CacheItemRow, CacheStoreLike } from './cache-store';
36
36
 
37
37
  // Dialects (advanced — for custom Kysely instances)
38
- export { D1Dialect } from './dialects/d1';
38
+ export { D1Adapter, D1Dialect } from './dialects/d1';
39
39
  export { LibsqlDialect } from './dialects/libsql';
40
40
 
41
41
  // Migrations & seeders