@lunora/d1 1.0.0-alpha.22 → 1.0.0-alpha.220

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.
@@ -1,27 +0,0 @@
1
- import { sqliteEncode, sqliteDecode } from '@lunora/sql-store';
2
- import { sql } from 'drizzle-orm';
3
- import { sqlAffinityForKind } from '../dialect.mjs';
4
-
5
- const UNIQUE_VIOLATION_RE = /unique constraint failed/iu;
6
- const sqliteDialect = {
7
- companionTypes: {
8
- autoincrementPrimaryKey: "INTEGER PRIMARY KEY AUTOINCREMENT",
9
- integer: "INTEGER",
10
- key: "TEXT",
11
- real: "REAL",
12
- text: "TEXT"
13
- },
14
- columnType: (kind) => sqlAffinityForKind(kind),
15
- decode: (value, kind) => sqliteDecode(value, kind),
16
- encode: (value) => sqliteEncode(value),
17
- frameworkColumns: () => [
18
- { name: "id", type: "TEXT PRIMARY KEY" },
19
- { name: "_creationTime", type: "REAL NOT NULL" }
20
- ],
21
- isUniqueViolation: (error) => error instanceof Error && UNIQUE_VIOLATION_RE.test(error.message),
22
- name: "sqlite",
23
- supportsReturning: true,
24
- tableExists: (table) => sql`SELECT name FROM sqlite_master WHERE type = 'table' AND name = ${table}`
25
- };
26
-
27
- export { sqliteDialect as default };