flint-orm 0.5.0 → 0.7.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/API.md +13 -13
- package/README.md +9 -9
- package/dist/drivers/better-sqlite3.d.ts +7 -3
- package/dist/drivers/bun-sqlite.d.ts +7 -3
- package/dist/drivers/lazy-executor.d.ts +3 -1
- package/dist/drivers/libsql-web.d.ts +7 -3
- package/dist/drivers/libsql.d.ts +7 -3
- package/dist/drivers/turso-sync.d.ts +9 -5
- package/dist/drivers/turso.d.ts +7 -3
- package/dist/executor.d.ts +4 -2
- package/dist/flint.d.ts +9 -7
- package/dist/index.d.ts +1 -1
- package/dist/query/builder.d.ts +12 -9
- package/dist/src/cli.js +16 -27
- package/dist/src/entries/better-sqlite3.js +6 -21
- package/dist/src/entries/bun-sqlite.js +6 -21
- package/dist/src/entries/expressions.js +4 -19
- package/dist/src/entries/libsql-web.js +6 -20
- package/dist/src/entries/libsql.js +6 -20
- package/dist/src/entries/turso-sync.js +6 -20
- package/dist/src/entries/turso.js +6 -20
- package/dist/src/index.js +4 -19
- package/package.json +13 -5
package/API.md
CHANGED
|
@@ -30,7 +30,7 @@ const users = table('users', {
|
|
|
30
30
|
const db = flint({ url: './app.db' });
|
|
31
31
|
|
|
32
32
|
// Query
|
|
33
|
-
const user = await db.
|
|
33
|
+
const user = await db.selectFrom(users).where(eq(users.id, 'u1')).single().execute();
|
|
34
34
|
// { id: "u1", name: "Alice", email: "alice@example.com", age: 30, createdAt: Date }
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -177,12 +177,12 @@ const users = table(
|
|
|
177
177
|
|
|
178
178
|
All `execute()` methods return `Promise<T>` — always `await` regardless of driver.
|
|
179
179
|
|
|
180
|
-
### `db.
|
|
180
|
+
### `db.selectFrom(table)`
|
|
181
181
|
|
|
182
|
-
Start a SELECT query.
|
|
182
|
+
Start a SELECT query. Call `.columns()` to narrow, `.where()` to filter, `.execute()` to run.
|
|
183
183
|
|
|
184
184
|
```ts
|
|
185
|
-
await db.
|
|
185
|
+
await db.selectFrom(users).execute();
|
|
186
186
|
// SELECT * FROM users
|
|
187
187
|
```
|
|
188
188
|
|
|
@@ -191,7 +191,7 @@ await db.select().from(users).execute();
|
|
|
191
191
|
Narrow which columns appear in the result.
|
|
192
192
|
|
|
193
193
|
```ts
|
|
194
|
-
await db.
|
|
194
|
+
await db.selectFrom(users).columns(['id', 'name']).execute();
|
|
195
195
|
// SELECT id, name FROM users
|
|
196
196
|
// Returns: { id: string; name: string }[]
|
|
197
197
|
```
|
|
@@ -201,7 +201,7 @@ await db.select().from(users).columns(['id', 'name']).execute();
|
|
|
201
201
|
Filter rows.
|
|
202
202
|
|
|
203
203
|
```ts
|
|
204
|
-
await db.
|
|
204
|
+
await db.selectFrom(users).where(eq(users.active, true)).execute();
|
|
205
205
|
// SELECT * FROM users WHERE active = 1
|
|
206
206
|
```
|
|
207
207
|
|
|
@@ -210,7 +210,7 @@ await db.select().from(users).where(eq(users.active, true)).execute();
|
|
|
210
210
|
Return one row or null instead of an array. Adds `LIMIT 1`.
|
|
211
211
|
|
|
212
212
|
```ts
|
|
213
|
-
await db.
|
|
213
|
+
await db.selectFrom(users).where(eq(users.id, 'u1')).single().execute();
|
|
214
214
|
// SELECT * FROM users WHERE id = ? LIMIT 1
|
|
215
215
|
// Returns: UserRow | null
|
|
216
216
|
```
|
|
@@ -220,7 +220,7 @@ await db.select().from(users).where(eq(users.id, 'u1')).single().execute();
|
|
|
220
220
|
Sort results. Default direction is `"asc"`.
|
|
221
221
|
|
|
222
222
|
```ts
|
|
223
|
-
await db.
|
|
223
|
+
await db.selectFrom(users).orderBy('name', 'desc').execute();
|
|
224
224
|
// SELECT * FROM users ORDER BY name DESC
|
|
225
225
|
```
|
|
226
226
|
|
|
@@ -229,7 +229,7 @@ await db.select().from(users).orderBy('name', 'desc').execute();
|
|
|
229
229
|
Limit the number of results.
|
|
230
230
|
|
|
231
231
|
```ts
|
|
232
|
-
await db.
|
|
232
|
+
await db.selectFrom(users).limit(10).execute();
|
|
233
233
|
// SELECT * FROM users LIMIT 10
|
|
234
234
|
```
|
|
235
235
|
|
|
@@ -238,7 +238,7 @@ await db.select().from(users).limit(10).execute();
|
|
|
238
238
|
Skip N rows.
|
|
239
239
|
|
|
240
240
|
```ts
|
|
241
|
-
await db.
|
|
241
|
+
await db.selectFrom(users).limit(10).offset(20).execute();
|
|
242
242
|
// SELECT * FROM users LIMIT 10 OFFSET 20
|
|
243
243
|
```
|
|
244
244
|
|
|
@@ -247,7 +247,7 @@ await db.select().from(users).limit(10).offset(20).execute();
|
|
|
247
247
|
Return unique rows.
|
|
248
248
|
|
|
249
249
|
```ts
|
|
250
|
-
await db.
|
|
250
|
+
await db.selectFrom(users).columns(['name']).distinct().execute();
|
|
251
251
|
// SELECT DISTINCT name FROM users
|
|
252
252
|
```
|
|
253
253
|
|
|
@@ -536,7 +536,7 @@ import { sql } from 'flint-orm';
|
|
|
536
536
|
const expr = sql`name = ${'Alice'} AND age > ${18}`;
|
|
537
537
|
// { sql: "name = ? AND age > ?", params: ["Alice", 18] }
|
|
538
538
|
|
|
539
|
-
const result = await db.
|
|
539
|
+
const result = await db.selectFrom(users).where(expr).execute();
|
|
540
540
|
```
|
|
541
541
|
|
|
542
542
|
---
|
|
@@ -595,7 +595,7 @@ import { addTable, dropTable, renameTable, addColumn, dropColumn, renameColumn,
|
|
|
595
595
|
| `dropIndex` | `DROP INDEX ...` |
|
|
596
596
|
| `modifyColumn` | `ALTER TABLE ... ALTER COLUMN ...` |
|
|
597
597
|
| `modifyIndex` | `DROP INDEX IF EXISTS ...; CREATE ...` |
|
|
598
|
-
| `rebuildTable` | Temp table → copy → drop → rename
|
|
598
|
+
| `rebuildTable` | Temp table → copy → drop → rename |
|
|
599
599
|
|
|
600
600
|
---
|
|
601
601
|
|
package/README.md
CHANGED
|
@@ -42,11 +42,11 @@ const db = flint({ url: './app.db' });
|
|
|
42
42
|
await db.insert(users).values({ id: 'u1', name: 'Alice', email: 'alice@example.com' }).execute();
|
|
43
43
|
|
|
44
44
|
// Query
|
|
45
|
-
const adults = await db.
|
|
45
|
+
const adults = await db.selectFrom(users).where(eq(users.age, 18)).execute();
|
|
46
46
|
// ^? { id: string; name: string; email: string; age: number; createdAt: Date }[]
|
|
47
47
|
|
|
48
48
|
// Single row
|
|
49
|
-
const alice = await db.
|
|
49
|
+
const alice = await db.selectFrom(users).where(eq(users.id, 'u1')).single().execute();
|
|
50
50
|
// ^? { id: string; name: string; email: string; age: number; createdAt: Date } | null
|
|
51
51
|
```
|
|
52
52
|
|
|
@@ -118,24 +118,24 @@ type NewUser = InsertRow<typeof users>;
|
|
|
118
118
|
|
|
119
119
|
```ts
|
|
120
120
|
// All rows
|
|
121
|
-
const all = await db.
|
|
121
|
+
const all = await db.selectFrom(users).execute();
|
|
122
122
|
|
|
123
123
|
// With conditions
|
|
124
|
-
const active = await db.
|
|
124
|
+
const active = await db.selectFrom(users).where(eq(users.active, true)).execute();
|
|
125
125
|
|
|
126
126
|
// Narrow columns
|
|
127
|
-
const names = await db.
|
|
127
|
+
const names = await db.selectFrom(users).columns(['id', 'name']).execute();
|
|
128
128
|
// ^? { id: string; name: string }[]
|
|
129
129
|
|
|
130
130
|
// Single row
|
|
131
|
-
const user = await db.
|
|
131
|
+
const user = await db.selectFrom(users).where(eq(users.id, 'u1')).single().execute();
|
|
132
132
|
// ^? { ... } | null
|
|
133
133
|
|
|
134
134
|
// Ordering and pagination
|
|
135
|
-
const page = await db.
|
|
135
|
+
const page = await db.selectFrom(users).orderBy('name', 'asc').limit(10).offset(20).execute();
|
|
136
136
|
|
|
137
137
|
// Distinct
|
|
138
|
-
const unique = await db.
|
|
138
|
+
const unique = await db.selectFrom(users).columns(['email']).distinct().execute();
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
### INSERT
|
|
@@ -236,7 +236,7 @@ await db.batch([db.insert(users).values({ id: 'u1', name: 'Alice' }), db.insert(
|
|
|
236
236
|
import { sql } from 'flint-orm';
|
|
237
237
|
|
|
238
238
|
const expr = sql`name = ${'Alice'} AND age > ${18}`;
|
|
239
|
-
const result = await db.
|
|
239
|
+
const result = await db.selectFrom(users).where(expr).execute();
|
|
240
240
|
|
|
241
241
|
// Direct execution
|
|
242
242
|
await db.$run('CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT)');
|
|
@@ -6,7 +6,9 @@ export declare class BetterSqlite3Executor implements Executor {
|
|
|
6
6
|
constructor(client: Database.Database);
|
|
7
7
|
all(sql: string, params: unknown[]): Promise<unknown[]>;
|
|
8
8
|
get(sql: string, params: unknown[]): Promise<unknown>;
|
|
9
|
-
run(sql: string, params: unknown[]): Promise<
|
|
9
|
+
run(sql: string, params: unknown[]): Promise<{
|
|
10
|
+
rowsAffected: number;
|
|
11
|
+
}>;
|
|
10
12
|
transaction(fn: () => void | Promise<void>): Promise<void>;
|
|
11
13
|
close(): void;
|
|
12
14
|
}
|
|
@@ -20,7 +22,7 @@ export declare class BetterSqlite3Executor implements Executor {
|
|
|
20
22
|
export declare function flint(options: {
|
|
21
23
|
url: string;
|
|
22
24
|
} & Database.Options): {
|
|
23
|
-
|
|
25
|
+
selectFrom: <T extends import("..").AnyTable>(table: T) => import("..").SelectBuilder<T>;
|
|
24
26
|
insert: <T extends import("..").AnyTable>(table: T) => import("..").InsertStage1<T>;
|
|
25
27
|
update: <T extends import("..").AnyTable>(table: T) => import("..").UpdateStage1<T>;
|
|
26
28
|
delete: <T extends import("..").AnyTable>(table: T) => import("../query/builder").DeleteBuilder<T, false, keyof import("..").InferRow<T>>;
|
|
@@ -33,6 +35,8 @@ export declare function flint(options: {
|
|
|
33
35
|
avg: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
34
36
|
min: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
35
37
|
max: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
36
|
-
$run(query: string, ...params: unknown[]): Promise<
|
|
38
|
+
$run(query: string, ...params: unknown[]): Promise<{
|
|
39
|
+
rowsAffected: number;
|
|
40
|
+
}>;
|
|
37
41
|
$executor: Executor;
|
|
38
42
|
};
|
|
@@ -7,7 +7,9 @@ export declare class BunSqliteExecutor implements Executor {
|
|
|
7
7
|
constructor(client: Database);
|
|
8
8
|
all(sql: string, params: unknown[]): Promise<unknown[]>;
|
|
9
9
|
get(sql: string, params: unknown[]): Promise<unknown>;
|
|
10
|
-
run(sql: string, params: unknown[]): Promise<
|
|
10
|
+
run(sql: string, params: unknown[]): Promise<{
|
|
11
|
+
rowsAffected: number;
|
|
12
|
+
}>;
|
|
11
13
|
transaction(fn: () => void | Promise<void>): Promise<void>;
|
|
12
14
|
close(): void;
|
|
13
15
|
}
|
|
@@ -21,7 +23,7 @@ export declare class BunSqliteExecutor implements Executor {
|
|
|
21
23
|
export declare function flint(options: {
|
|
22
24
|
url: string;
|
|
23
25
|
} & DatabaseOptions): {
|
|
24
|
-
|
|
26
|
+
selectFrom: <T extends import("..").AnyTable>(table: T) => import("..").SelectBuilder<T>;
|
|
25
27
|
insert: <T extends import("..").AnyTable>(table: T) => import("..").InsertStage1<T>;
|
|
26
28
|
update: <T extends import("..").AnyTable>(table: T) => import("..").UpdateStage1<T>;
|
|
27
29
|
delete: <T extends import("..").AnyTable>(table: T) => import("../query/builder").DeleteBuilder<T, false, keyof import("..").InferRow<T>>;
|
|
@@ -34,6 +36,8 @@ export declare function flint(options: {
|
|
|
34
36
|
avg: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
35
37
|
min: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
36
38
|
max: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
37
|
-
$run(query: string, ...params: unknown[]): Promise<
|
|
39
|
+
$run(query: string, ...params: unknown[]): Promise<{
|
|
40
|
+
rowsAffected: number;
|
|
41
|
+
}>;
|
|
38
42
|
$executor: Executor;
|
|
39
43
|
};
|
|
@@ -8,7 +8,9 @@ export declare class LazyExecutor implements Executor {
|
|
|
8
8
|
constructor(factory: () => Promise<Executor>);
|
|
9
9
|
all(sql: string, params: unknown[]): Promise<unknown[]>;
|
|
10
10
|
get(sql: string, params: unknown[]): Promise<unknown>;
|
|
11
|
-
run(sql: string, params: unknown[]): Promise<
|
|
11
|
+
run(sql: string, params: unknown[]): Promise<{
|
|
12
|
+
rowsAffected: number;
|
|
13
|
+
}>;
|
|
12
14
|
transaction(fn: () => void | Promise<void>): Promise<void>;
|
|
13
15
|
close(): void;
|
|
14
16
|
}
|
|
@@ -6,7 +6,9 @@ export declare class LibsqlWebExecutor implements Executor {
|
|
|
6
6
|
constructor(client: Client);
|
|
7
7
|
all(sql: string, params: unknown[]): Promise<unknown[]>;
|
|
8
8
|
get(sql: string, params: unknown[]): Promise<unknown>;
|
|
9
|
-
run(sql: string, params: unknown[]): Promise<
|
|
9
|
+
run(sql: string, params: unknown[]): Promise<{
|
|
10
|
+
rowsAffected: number;
|
|
11
|
+
}>;
|
|
10
12
|
transaction(fn: () => void | Promise<void>): Promise<void>;
|
|
11
13
|
close(): void;
|
|
12
14
|
}
|
|
@@ -21,7 +23,7 @@ export declare class LibsqlWebExecutor implements Executor {
|
|
|
21
23
|
* const db = flint({ url: 'libsql://your-db.turso.io', authToken: '...' })
|
|
22
24
|
*/
|
|
23
25
|
export declare function flint(options: Config): {
|
|
24
|
-
|
|
26
|
+
selectFrom: <T extends import("..").AnyTable>(table: T) => import("..").SelectBuilder<T>;
|
|
25
27
|
insert: <T extends import("..").AnyTable>(table: T) => import("..").InsertStage1<T>;
|
|
26
28
|
update: <T extends import("..").AnyTable>(table: T) => import("..").UpdateStage1<T>;
|
|
27
29
|
delete: <T extends import("..").AnyTable>(table: T) => import("../query/builder").DeleteBuilder<T, false, keyof import("..").InferRow<T>>;
|
|
@@ -34,6 +36,8 @@ export declare function flint(options: Config): {
|
|
|
34
36
|
avg: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
35
37
|
min: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
36
38
|
max: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
37
|
-
$run(query: string, ...params: unknown[]): Promise<
|
|
39
|
+
$run(query: string, ...params: unknown[]): Promise<{
|
|
40
|
+
rowsAffected: number;
|
|
41
|
+
}>;
|
|
38
42
|
$executor: Executor;
|
|
39
43
|
};
|
package/dist/drivers/libsql.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ export declare class LibsqlExecutor implements Executor {
|
|
|
6
6
|
constructor(client: Client);
|
|
7
7
|
all(sql: string, params: unknown[]): Promise<unknown[]>;
|
|
8
8
|
get(sql: string, params: unknown[]): Promise<unknown>;
|
|
9
|
-
run(sql: string, params: unknown[]): Promise<
|
|
9
|
+
run(sql: string, params: unknown[]): Promise<{
|
|
10
|
+
rowsAffected: number;
|
|
11
|
+
}>;
|
|
10
12
|
transaction(fn: () => void | Promise<void>): Promise<void>;
|
|
11
13
|
close(): void;
|
|
12
14
|
}
|
|
@@ -18,7 +20,7 @@ export declare class LibsqlExecutor implements Executor {
|
|
|
18
20
|
* const db = flint({ url: 'libsql://your-db.turso.io', authToken: '...' })
|
|
19
21
|
*/
|
|
20
22
|
export declare function flint(options: Config): {
|
|
21
|
-
|
|
23
|
+
selectFrom: <T extends import("..").AnyTable>(table: T) => import("..").SelectBuilder<T>;
|
|
22
24
|
insert: <T extends import("..").AnyTable>(table: T) => import("..").InsertStage1<T>;
|
|
23
25
|
update: <T extends import("..").AnyTable>(table: T) => import("..").UpdateStage1<T>;
|
|
24
26
|
delete: <T extends import("..").AnyTable>(table: T) => import("../query/builder").DeleteBuilder<T, false, keyof import("..").InferRow<T>>;
|
|
@@ -31,6 +33,8 @@ export declare function flint(options: Config): {
|
|
|
31
33
|
avg: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
32
34
|
min: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
33
35
|
max: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
34
|
-
$run(query: string, ...params: unknown[]): Promise<
|
|
36
|
+
$run(query: string, ...params: unknown[]): Promise<{
|
|
37
|
+
rowsAffected: number;
|
|
38
|
+
}>;
|
|
35
39
|
$executor: Executor;
|
|
36
40
|
};
|
|
@@ -6,14 +6,16 @@ export declare class TursoSyncExecutor implements Executor {
|
|
|
6
6
|
constructor(db: Database);
|
|
7
7
|
all(sql: string, params: unknown[]): Promise<unknown[]>;
|
|
8
8
|
get(sql: string, params: unknown[]): Promise<unknown>;
|
|
9
|
-
run(sql: string, params: unknown[]): Promise<
|
|
9
|
+
run(sql: string, params: unknown[]): Promise<{
|
|
10
|
+
rowsAffected: number;
|
|
11
|
+
}>;
|
|
10
12
|
transaction(fn: () => void | Promise<void>): Promise<void>;
|
|
11
13
|
close(): void;
|
|
12
14
|
}
|
|
13
15
|
export interface TursoSyncOptions extends Omit<DatabaseOpts, 'path' | 'url' | 'authToken'> {
|
|
14
|
-
/** Local path for the synced database files. */
|
|
16
|
+
/** Local path for the synced database files (maps to `path` in `@tursodatabase/sync`). */
|
|
15
17
|
url: string;
|
|
16
|
-
/** Remote Turso database URL (
|
|
18
|
+
/** Remote Turso database URL (maps to `url` in `@tursodatabase/sync`). */
|
|
17
19
|
syncUrl?: string;
|
|
18
20
|
/** Auth token for the remote database. */
|
|
19
21
|
authToken?: DatabaseOpts['authToken'];
|
|
@@ -28,7 +30,7 @@ export interface TursoSyncOptions extends Omit<DatabaseOpts, 'path' | 'url' | 'a
|
|
|
28
30
|
* const db = flint({ url: './local.db', syncUrl: 'libsql://db.turso.io', authToken: '...' })
|
|
29
31
|
*/
|
|
30
32
|
export declare function flint(options: TursoSyncOptions): {
|
|
31
|
-
|
|
33
|
+
selectFrom: <T extends import("..").AnyTable>(table: T) => import("..").SelectBuilder<T>;
|
|
32
34
|
insert: <T extends import("..").AnyTable>(table: T) => import("..").InsertStage1<T>;
|
|
33
35
|
update: <T extends import("..").AnyTable>(table: T) => import("..").UpdateStage1<T>;
|
|
34
36
|
delete: <T extends import("..").AnyTable>(table: T) => import("../query/builder").DeleteBuilder<T, false, keyof import("..").InferRow<T>>;
|
|
@@ -41,6 +43,8 @@ export declare function flint(options: TursoSyncOptions): {
|
|
|
41
43
|
avg: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
42
44
|
min: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
43
45
|
max: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
44
|
-
$run(query: string, ...params: unknown[]): Promise<
|
|
46
|
+
$run(query: string, ...params: unknown[]): Promise<{
|
|
47
|
+
rowsAffected: number;
|
|
48
|
+
}>;
|
|
45
49
|
$executor: Executor;
|
|
46
50
|
};
|
package/dist/drivers/turso.d.ts
CHANGED
|
@@ -7,7 +7,9 @@ export declare class TursoExecutor implements Executor {
|
|
|
7
7
|
constructor(db: Database);
|
|
8
8
|
all(sql: string, params: unknown[]): Promise<unknown[]>;
|
|
9
9
|
get(sql: string, params: unknown[]): Promise<unknown>;
|
|
10
|
-
run(sql: string, params: unknown[]): Promise<
|
|
10
|
+
run(sql: string, params: unknown[]): Promise<{
|
|
11
|
+
rowsAffected: number;
|
|
12
|
+
}>;
|
|
11
13
|
transaction(fn: () => void | Promise<void>): Promise<void>;
|
|
12
14
|
close(): void;
|
|
13
15
|
}
|
|
@@ -23,7 +25,7 @@ export declare class TursoExecutor implements Executor {
|
|
|
23
25
|
export declare function flint(options: {
|
|
24
26
|
url: string;
|
|
25
27
|
} & Parameters<typeof connect>[1]): {
|
|
26
|
-
|
|
28
|
+
selectFrom: <T extends import("..").AnyTable>(table: T) => import("..").SelectBuilder<T>;
|
|
27
29
|
insert: <T extends import("..").AnyTable>(table: T) => import("..").InsertStage1<T>;
|
|
28
30
|
update: <T extends import("..").AnyTable>(table: T) => import("..").UpdateStage1<T>;
|
|
29
31
|
delete: <T extends import("..").AnyTable>(table: T) => import("../query/builder").DeleteBuilder<T, false, keyof import("..").InferRow<T>>;
|
|
@@ -36,6 +38,8 @@ export declare function flint(options: {
|
|
|
36
38
|
avg: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
37
39
|
min: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
38
40
|
max: <T extends import("..").AnyTable, C extends import("..").ColumnDef<any, any>>(table: T, column: C, condition?: import("..").Condition) => Promise<number | null>;
|
|
39
|
-
$run(query: string, ...params: unknown[]): Promise<
|
|
41
|
+
$run(query: string, ...params: unknown[]): Promise<{
|
|
42
|
+
rowsAffected: number;
|
|
43
|
+
}>;
|
|
40
44
|
$executor: Executor;
|
|
41
45
|
};
|
package/dist/executor.d.ts
CHANGED
|
@@ -7,8 +7,10 @@ export interface Executor {
|
|
|
7
7
|
all(sql: string, params: unknown[]): Promise<unknown[]>;
|
|
8
8
|
/** Execute a query and return a single row or null. */
|
|
9
9
|
get(sql: string, params: unknown[]): Promise<unknown>;
|
|
10
|
-
/** Execute a statement (INSERT, UPDATE, DELETE, DDL). */
|
|
11
|
-
run(sql: string, params: unknown[]): Promise<
|
|
10
|
+
/** Execute a statement (INSERT, UPDATE, DELETE, DDL) and return affected row count. */
|
|
11
|
+
run(sql: string, params: unknown[]): Promise<{
|
|
12
|
+
rowsAffected: number;
|
|
13
|
+
}>;
|
|
12
14
|
/** Run a callback inside a transaction. */
|
|
13
15
|
transaction(fn: () => void | Promise<void>): Promise<void>;
|
|
14
16
|
/** Close the underlying database connection. No-op if already closed. */
|
package/dist/flint.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Executor } from './executor';
|
|
2
|
-
import { DeleteBuilder } from './query/builder';
|
|
3
|
-
import type { Executable,
|
|
2
|
+
import { SelectBuilder, DeleteBuilder } from './query/builder';
|
|
3
|
+
import type { Executable, InsertStage1, UpdateStage1, JoinSelectStage1 } from './query/builder';
|
|
4
4
|
import type { AnyTable } from './schema/table';
|
|
5
5
|
import type { Condition } from './query/conditions';
|
|
6
6
|
import type { ColumnDef } from './schema/columns';
|
|
7
|
-
export type { Executable,
|
|
7
|
+
export type { Executable, SelectBuilder, InsertStage1, UpdateStage1, JoinSelectStage1, JoinBuilder, SingleJoinBuilder } from './query/builder';
|
|
8
8
|
export type { JoinResult } from './query/builder';
|
|
9
9
|
/**
|
|
10
10
|
* A raw SQL expression with parameters.
|
|
@@ -29,12 +29,12 @@ export interface SQLExpression {
|
|
|
29
29
|
*/
|
|
30
30
|
export declare function createClient(executor: Executor): {
|
|
31
31
|
/**
|
|
32
|
-
* Start a SELECT query —
|
|
32
|
+
* Start a SELECT query — pass a table definition.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
|
-
* const rows = db.
|
|
35
|
+
* const rows = db.selectFrom(users).execute()
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
selectFrom: <T extends AnyTable>(table: T) => SelectBuilder<T>;
|
|
38
38
|
/**
|
|
39
39
|
* Start an INSERT — call `.values(row)` next.
|
|
40
40
|
*
|
|
@@ -107,7 +107,9 @@ export declare function createClient(executor: Executor): {
|
|
|
107
107
|
/**
|
|
108
108
|
* Execute raw SQL directly against the database.
|
|
109
109
|
*/
|
|
110
|
-
$run(query: string, ...params: unknown[]): Promise<
|
|
110
|
+
$run(query: string, ...params: unknown[]): Promise<{
|
|
111
|
+
rowsAffected: number;
|
|
112
|
+
}>;
|
|
111
113
|
/** Direct access to the underlying executor. */
|
|
112
114
|
$executor: Executor;
|
|
113
115
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { sql, createClient } from './flint';
|
|
2
|
-
export type { SQLExpression, Executable,
|
|
2
|
+
export type { SQLExpression, Executable, SelectBuilder, InsertStage1, UpdateStage1 } from './flint';
|
|
3
3
|
export type { Executor } from './executor';
|
|
4
4
|
export { text, integer, boolean, json, date, real } from './schema/columns';
|
|
5
5
|
export type { ColumnDef, IntegerColumnDef, DateColumnDef, DateColumnDefWithDefault } from './schema/columns';
|
package/dist/query/builder.d.ts
CHANGED
|
@@ -24,12 +24,9 @@ export interface Executable {
|
|
|
24
24
|
params: unknown[];
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
/** Phase 1 of a SELECT — only `.from()` is available. */
|
|
28
|
-
export interface SelectStage1 {
|
|
29
|
-
from<U extends AnyTable>(table: U): SelectBuilder<U>;
|
|
30
|
-
}
|
|
31
27
|
/**
|
|
32
|
-
* Full SELECT builder —
|
|
28
|
+
* Full SELECT builder — created directly via `db.selectFrom(table)`.
|
|
29
|
+
* Entry point: `db.selectFrom(table)`.
|
|
33
30
|
* Returns `InferRow<T>[]` (all columns) from `execute()`.
|
|
34
31
|
* Call `.columns()` to narrow — returns a `NarrowedSelectBuilder`.
|
|
35
32
|
*/
|
|
@@ -46,7 +43,7 @@ export declare class SelectBuilder<T extends AnyTable> implements Executable {
|
|
|
46
43
|
* Returns a `NarrowedSelectBuilder` with a clean `{ id: string; name: string }` return type.
|
|
47
44
|
*
|
|
48
45
|
* @example
|
|
49
|
-
* db.
|
|
46
|
+
* db.selectFrom(users).columns(["id", "name"]).execute()
|
|
50
47
|
* // ^? { id: string; name: string }[]
|
|
51
48
|
*/
|
|
52
49
|
columns<K extends keyof InferRow<T>>(keys: K[]): NarrowedSelectBuilder<T, K>;
|
|
@@ -205,7 +202,9 @@ export declare class InsertBuilder<T extends AnyTable, R extends boolean = false
|
|
|
205
202
|
sql: string;
|
|
206
203
|
params: unknown[];
|
|
207
204
|
};
|
|
208
|
-
execute(): Promise<R extends true ? Prettify<NarrowRow<InferRow<T>, K>>[] :
|
|
205
|
+
execute(): Promise<R extends true ? Prettify<NarrowRow<InferRow<T>, K>>[] : {
|
|
206
|
+
rowsAffected: number;
|
|
207
|
+
}>;
|
|
209
208
|
}
|
|
210
209
|
/** Phase 1 of an UPDATE — only `.set()` is available. */
|
|
211
210
|
export interface UpdateStage1<T extends AnyTable> {
|
|
@@ -231,7 +230,9 @@ export declare class UpdateBuilder<T extends AnyTable, R extends boolean = false
|
|
|
231
230
|
sql: string;
|
|
232
231
|
params: unknown[];
|
|
233
232
|
};
|
|
234
|
-
execute(): Promise<R extends true ? Prettify<NarrowRow<InferRow<T>, K>>[] :
|
|
233
|
+
execute(): Promise<R extends true ? Prettify<NarrowRow<InferRow<T>, K>>[] : {
|
|
234
|
+
rowsAffected: number;
|
|
235
|
+
}>;
|
|
235
236
|
}
|
|
236
237
|
/** Full DELETE builder — chain `.where()` calls then `.execute()`. */
|
|
237
238
|
export declare class DeleteBuilder<T extends AnyTable, R extends boolean = false, K extends keyof InferRow<T> = keyof InferRow<T>> implements Executable {
|
|
@@ -252,6 +253,8 @@ export declare class DeleteBuilder<T extends AnyTable, R extends boolean = false
|
|
|
252
253
|
sql: string;
|
|
253
254
|
params: unknown[];
|
|
254
255
|
};
|
|
255
|
-
execute(): Promise<R extends true ? Prettify<NarrowRow<InferRow<T>, K>>[] :
|
|
256
|
+
execute(): Promise<R extends true ? Prettify<NarrowRow<InferRow<T>, K>>[] : {
|
|
257
|
+
rowsAffected: number;
|
|
258
|
+
}>;
|
|
256
259
|
}
|
|
257
260
|
export {};
|
package/dist/src/cli.js
CHANGED
|
@@ -1376,18 +1376,6 @@ function resolveColumns(table, selectedColumns, prefix) {
|
|
|
1376
1376
|
return entries.map(([, c3]) => prefix ? `${prefix}.${c3.name}` : c3.name).join(", ");
|
|
1377
1377
|
}
|
|
1378
1378
|
|
|
1379
|
-
class SelectFromBuilder {
|
|
1380
|
-
#executor;
|
|
1381
|
-
#conditions;
|
|
1382
|
-
constructor(executor, conditions = []) {
|
|
1383
|
-
this.#executor = executor;
|
|
1384
|
-
this.#conditions = conditions;
|
|
1385
|
-
}
|
|
1386
|
-
from(table) {
|
|
1387
|
-
return new SelectBuilder(this.#executor, table._.name, table, this.#conditions);
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
1379
|
class SelectBuilder {
|
|
1392
1380
|
#executor;
|
|
1393
1381
|
#tableName;
|
|
@@ -2066,8 +2054,7 @@ class InsertBuilder {
|
|
|
2066
2054
|
}
|
|
2067
2055
|
return records.map((r2) => decodeRow(r2, this.#table));
|
|
2068
2056
|
}
|
|
2069
|
-
await this.#executor.run(sql, params);
|
|
2070
|
-
return;
|
|
2057
|
+
return await this.#executor.run(sql, params);
|
|
2071
2058
|
} catch (e) {
|
|
2072
2059
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
2073
2060
|
}
|
|
@@ -2151,8 +2138,7 @@ class UpdateBuilder {
|
|
|
2151
2138
|
}
|
|
2152
2139
|
return records.map((r2) => decodeRow(r2, this.#table));
|
|
2153
2140
|
}
|
|
2154
|
-
await this.#executor.run(sql, params);
|
|
2155
|
-
return;
|
|
2141
|
+
return await this.#executor.run(sql, params);
|
|
2156
2142
|
} catch (e) {
|
|
2157
2143
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
2158
2144
|
}
|
|
@@ -2206,8 +2192,7 @@ class DeleteBuilder {
|
|
|
2206
2192
|
}
|
|
2207
2193
|
return records.map((r2) => decodeRow(r2, this.#table));
|
|
2208
2194
|
}
|
|
2209
|
-
await this.#executor.run(sql, params);
|
|
2210
|
-
return;
|
|
2195
|
+
return await this.#executor.run(sql, params);
|
|
2211
2196
|
} catch (e) {
|
|
2212
2197
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
2213
2198
|
}
|
|
@@ -2284,7 +2269,7 @@ var init_aggregates = () => {};
|
|
|
2284
2269
|
// src/flint.ts
|
|
2285
2270
|
function createClient(executor) {
|
|
2286
2271
|
return {
|
|
2287
|
-
|
|
2272
|
+
selectFrom: (table) => new SelectBuilder(executor, table._.name, table),
|
|
2288
2273
|
insert: (table) => new InsertValuesBuilder(executor, table._.name, table),
|
|
2289
2274
|
update: (table) => new UpdateSetBuilder(executor, table._.name, table),
|
|
2290
2275
|
delete: (table) => new DeleteBuilder(executor, table._.name, table),
|
|
@@ -2347,8 +2332,8 @@ class BunSqliteExecutor {
|
|
|
2347
2332
|
return Promise.resolve(this.#client.prepare(sql2).get(...params));
|
|
2348
2333
|
}
|
|
2349
2334
|
run(sql2, params) {
|
|
2350
|
-
this.#client.prepare(sql2).run(...params);
|
|
2351
|
-
return Promise.resolve();
|
|
2335
|
+
const result = this.#client.prepare(sql2).run(...params);
|
|
2336
|
+
return Promise.resolve({ rowsAffected: result.changes });
|
|
2352
2337
|
}
|
|
2353
2338
|
transaction(fn) {
|
|
2354
2339
|
this.#client.run("BEGIN");
|
|
@@ -3166,8 +3151,8 @@ class BetterSqlite3Executor {
|
|
|
3166
3151
|
return Promise.resolve(this.#client.prepare(sql2).get(...params));
|
|
3167
3152
|
}
|
|
3168
3153
|
run(sql2, params) {
|
|
3169
|
-
this.#client.prepare(sql2).run(...params);
|
|
3170
|
-
return Promise.resolve();
|
|
3154
|
+
const result = this.#client.prepare(sql2).run(...params);
|
|
3155
|
+
return Promise.resolve({ rowsAffected: result.changes });
|
|
3171
3156
|
}
|
|
3172
3157
|
transaction(fn) {
|
|
3173
3158
|
this.#client.exec("BEGIN");
|
|
@@ -9153,7 +9138,8 @@ class LibsqlExecutor {
|
|
|
9153
9138
|
return result.rows[0] ?? null;
|
|
9154
9139
|
}
|
|
9155
9140
|
async run(sql2, params) {
|
|
9156
|
-
await this.#client.execute({ sql: sql2, args: sanitize(params) });
|
|
9141
|
+
const result = await this.#client.execute({ sql: sql2, args: sanitize(params) });
|
|
9142
|
+
return { rowsAffected: result.rowsAffected };
|
|
9157
9143
|
}
|
|
9158
9144
|
async transaction(fn) {
|
|
9159
9145
|
await this.#client.execute("BEGIN");
|
|
@@ -9231,7 +9217,8 @@ class LibsqlWebExecutor {
|
|
|
9231
9217
|
return result.rows[0] ?? null;
|
|
9232
9218
|
}
|
|
9233
9219
|
async run(sql2, params) {
|
|
9234
|
-
await this.#client.execute({ sql: sql2, args: sanitize2(params) });
|
|
9220
|
+
const result = await this.#client.execute({ sql: sql2, args: sanitize2(params) });
|
|
9221
|
+
return { rowsAffected: result.rowsAffected };
|
|
9235
9222
|
}
|
|
9236
9223
|
async transaction(fn) {
|
|
9237
9224
|
await this.#client.execute("BEGIN");
|
|
@@ -11540,7 +11527,8 @@ class TursoSyncExecutor {
|
|
|
11540
11527
|
return this.#db.get(sql2, ...sanitize3(params)) ?? null;
|
|
11541
11528
|
}
|
|
11542
11529
|
async run(sql2, params) {
|
|
11543
|
-
await this.#db.run(sql2, ...sanitize3(params));
|
|
11530
|
+
const result = await this.#db.run(sql2, ...sanitize3(params));
|
|
11531
|
+
return { rowsAffected: result.changes };
|
|
11544
11532
|
}
|
|
11545
11533
|
async transaction(fn) {
|
|
11546
11534
|
await this.#db.exec("BEGIN");
|
|
@@ -12130,7 +12118,8 @@ class TursoExecutor {
|
|
|
12130
12118
|
return this.#db.get(sql2, ...sanitize4(params)) ?? null;
|
|
12131
12119
|
}
|
|
12132
12120
|
async run(sql2, params) {
|
|
12133
|
-
await this.#db.run(sql2, ...sanitize4(params));
|
|
12121
|
+
const result = await this.#db.run(sql2, ...sanitize4(params));
|
|
12122
|
+
return { rowsAffected: result.changes };
|
|
12134
12123
|
}
|
|
12135
12124
|
async transaction(fn) {
|
|
12136
12125
|
await this.#db.exec("BEGIN");
|
|
@@ -1037,18 +1037,6 @@ function resolveColumns(table, selectedColumns, prefix) {
|
|
|
1037
1037
|
return entries.map(([, c]) => prefix ? `${prefix}.${c.name}` : c.name).join(", ");
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
|
-
class SelectFromBuilder {
|
|
1041
|
-
#executor;
|
|
1042
|
-
#conditions;
|
|
1043
|
-
constructor(executor, conditions = []) {
|
|
1044
|
-
this.#executor = executor;
|
|
1045
|
-
this.#conditions = conditions;
|
|
1046
|
-
}
|
|
1047
|
-
from(table) {
|
|
1048
|
-
return new SelectBuilder(this.#executor, table._.name, table, this.#conditions);
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
1040
|
class SelectBuilder {
|
|
1053
1041
|
#executor;
|
|
1054
1042
|
#tableName;
|
|
@@ -1727,8 +1715,7 @@ class InsertBuilder {
|
|
|
1727
1715
|
}
|
|
1728
1716
|
return records.map((r) => decodeRow(r, this.#table));
|
|
1729
1717
|
}
|
|
1730
|
-
await this.#executor.run(sql, params);
|
|
1731
|
-
return;
|
|
1718
|
+
return await this.#executor.run(sql, params);
|
|
1732
1719
|
} catch (e) {
|
|
1733
1720
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
1734
1721
|
}
|
|
@@ -1812,8 +1799,7 @@ class UpdateBuilder {
|
|
|
1812
1799
|
}
|
|
1813
1800
|
return records.map((r) => decodeRow(r, this.#table));
|
|
1814
1801
|
}
|
|
1815
|
-
await this.#executor.run(sql, params);
|
|
1816
|
-
return;
|
|
1802
|
+
return await this.#executor.run(sql, params);
|
|
1817
1803
|
} catch (e) {
|
|
1818
1804
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
1819
1805
|
}
|
|
@@ -1867,8 +1853,7 @@ class DeleteBuilder {
|
|
|
1867
1853
|
}
|
|
1868
1854
|
return records.map((r) => decodeRow(r, this.#table));
|
|
1869
1855
|
}
|
|
1870
|
-
await this.#executor.run(sql, params);
|
|
1871
|
-
return;
|
|
1856
|
+
return await this.#executor.run(sql, params);
|
|
1872
1857
|
} catch (e) {
|
|
1873
1858
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
1874
1859
|
}
|
|
@@ -1945,7 +1930,7 @@ var init_aggregates = () => {};
|
|
|
1945
1930
|
// src/flint.ts
|
|
1946
1931
|
function createClient(executor) {
|
|
1947
1932
|
return {
|
|
1948
|
-
|
|
1933
|
+
selectFrom: (table) => new SelectBuilder(executor, table._.name, table),
|
|
1949
1934
|
insert: (table) => new InsertValuesBuilder(executor, table._.name, table),
|
|
1950
1935
|
update: (table) => new UpdateSetBuilder(executor, table._.name, table),
|
|
1951
1936
|
delete: (table) => new DeleteBuilder(executor, table._.name, table),
|
|
@@ -2007,8 +1992,8 @@ class BetterSqlite3Executor {
|
|
|
2007
1992
|
return Promise.resolve(this.#client.prepare(sql2).get(...params));
|
|
2008
1993
|
}
|
|
2009
1994
|
run(sql2, params) {
|
|
2010
|
-
this.#client.prepare(sql2).run(...params);
|
|
2011
|
-
return Promise.resolve();
|
|
1995
|
+
const result = this.#client.prepare(sql2).run(...params);
|
|
1996
|
+
return Promise.resolve({ rowsAffected: result.changes });
|
|
2012
1997
|
}
|
|
2013
1998
|
transaction(fn) {
|
|
2014
1999
|
this.#client.exec("BEGIN");
|
|
@@ -272,18 +272,6 @@ function resolveColumns(table, selectedColumns, prefix) {
|
|
|
272
272
|
return entries.map(([, c]) => prefix ? `${prefix}.${c.name}` : c.name).join(", ");
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
class SelectFromBuilder {
|
|
276
|
-
#executor;
|
|
277
|
-
#conditions;
|
|
278
|
-
constructor(executor, conditions = []) {
|
|
279
|
-
this.#executor = executor;
|
|
280
|
-
this.#conditions = conditions;
|
|
281
|
-
}
|
|
282
|
-
from(table) {
|
|
283
|
-
return new SelectBuilder(this.#executor, table._.name, table, this.#conditions);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
275
|
class SelectBuilder {
|
|
288
276
|
#executor;
|
|
289
277
|
#tableName;
|
|
@@ -962,8 +950,7 @@ class InsertBuilder {
|
|
|
962
950
|
}
|
|
963
951
|
return records.map((r) => decodeRow(r, this.#table));
|
|
964
952
|
}
|
|
965
|
-
await this.#executor.run(sql, params);
|
|
966
|
-
return;
|
|
953
|
+
return await this.#executor.run(sql, params);
|
|
967
954
|
} catch (e) {
|
|
968
955
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
969
956
|
}
|
|
@@ -1047,8 +1034,7 @@ class UpdateBuilder {
|
|
|
1047
1034
|
}
|
|
1048
1035
|
return records.map((r) => decodeRow(r, this.#table));
|
|
1049
1036
|
}
|
|
1050
|
-
await this.#executor.run(sql, params);
|
|
1051
|
-
return;
|
|
1037
|
+
return await this.#executor.run(sql, params);
|
|
1052
1038
|
} catch (e) {
|
|
1053
1039
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
1054
1040
|
}
|
|
@@ -1102,8 +1088,7 @@ class DeleteBuilder {
|
|
|
1102
1088
|
}
|
|
1103
1089
|
return records.map((r) => decodeRow(r, this.#table));
|
|
1104
1090
|
}
|
|
1105
|
-
await this.#executor.run(sql, params);
|
|
1106
|
-
return;
|
|
1091
|
+
return await this.#executor.run(sql, params);
|
|
1107
1092
|
} catch (e) {
|
|
1108
1093
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
1109
1094
|
}
|
|
@@ -1180,7 +1165,7 @@ var init_aggregates = () => {};
|
|
|
1180
1165
|
// src/flint.ts
|
|
1181
1166
|
function createClient(executor) {
|
|
1182
1167
|
return {
|
|
1183
|
-
|
|
1168
|
+
selectFrom: (table) => new SelectBuilder(executor, table._.name, table),
|
|
1184
1169
|
insert: (table) => new InsertValuesBuilder(executor, table._.name, table),
|
|
1185
1170
|
update: (table) => new UpdateSetBuilder(executor, table._.name, table),
|
|
1186
1171
|
delete: (table) => new DeleteBuilder(executor, table._.name, table),
|
|
@@ -1243,8 +1228,8 @@ class BunSqliteExecutor {
|
|
|
1243
1228
|
return Promise.resolve(this.#client.prepare(sql2).get(...params));
|
|
1244
1229
|
}
|
|
1245
1230
|
run(sql2, params) {
|
|
1246
|
-
this.#client.prepare(sql2).run(...params);
|
|
1247
|
-
return Promise.resolve();
|
|
1231
|
+
const result = this.#client.prepare(sql2).run(...params);
|
|
1232
|
+
return Promise.resolve({ rowsAffected: result.changes });
|
|
1248
1233
|
}
|
|
1249
1234
|
transaction(fn) {
|
|
1250
1235
|
this.#client.run("BEGIN");
|
|
@@ -272,18 +272,6 @@ function resolveColumns(table, selectedColumns, prefix) {
|
|
|
272
272
|
return entries.map(([, c]) => prefix ? `${prefix}.${c.name}` : c.name).join(", ");
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
class SelectFromBuilder {
|
|
276
|
-
#executor;
|
|
277
|
-
#conditions;
|
|
278
|
-
constructor(executor, conditions = []) {
|
|
279
|
-
this.#executor = executor;
|
|
280
|
-
this.#conditions = conditions;
|
|
281
|
-
}
|
|
282
|
-
from(table) {
|
|
283
|
-
return new SelectBuilder(this.#executor, table._.name, table, this.#conditions);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
275
|
class SelectBuilder {
|
|
288
276
|
#executor;
|
|
289
277
|
#tableName;
|
|
@@ -962,8 +950,7 @@ class InsertBuilder {
|
|
|
962
950
|
}
|
|
963
951
|
return records.map((r) => decodeRow(r, this.#table));
|
|
964
952
|
}
|
|
965
|
-
await this.#executor.run(sql, params);
|
|
966
|
-
return;
|
|
953
|
+
return await this.#executor.run(sql, params);
|
|
967
954
|
} catch (e) {
|
|
968
955
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
969
956
|
}
|
|
@@ -1047,8 +1034,7 @@ class UpdateBuilder {
|
|
|
1047
1034
|
}
|
|
1048
1035
|
return records.map((r) => decodeRow(r, this.#table));
|
|
1049
1036
|
}
|
|
1050
|
-
await this.#executor.run(sql, params);
|
|
1051
|
-
return;
|
|
1037
|
+
return await this.#executor.run(sql, params);
|
|
1052
1038
|
} catch (e) {
|
|
1053
1039
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
1054
1040
|
}
|
|
@@ -1102,8 +1088,7 @@ class DeleteBuilder {
|
|
|
1102
1088
|
}
|
|
1103
1089
|
return records.map((r) => decodeRow(r, this.#table));
|
|
1104
1090
|
}
|
|
1105
|
-
await this.#executor.run(sql, params);
|
|
1106
|
-
return;
|
|
1091
|
+
return await this.#executor.run(sql, params);
|
|
1107
1092
|
} catch (e) {
|
|
1108
1093
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
1109
1094
|
}
|
|
@@ -1180,7 +1165,7 @@ var init_aggregates = () => {};
|
|
|
1180
1165
|
// src/flint.ts
|
|
1181
1166
|
function createClient(executor) {
|
|
1182
1167
|
return {
|
|
1183
|
-
|
|
1168
|
+
selectFrom: (table) => new SelectBuilder(executor, table._.name, table),
|
|
1184
1169
|
insert: (table) => new InsertValuesBuilder(executor, table._.name, table),
|
|
1185
1170
|
update: (table) => new UpdateSetBuilder(executor, table._.name, table),
|
|
1186
1171
|
delete: (table) => new DeleteBuilder(executor, table._.name, table),
|
|
@@ -5058,18 +5058,6 @@ function resolveColumns(table, selectedColumns, prefix) {
|
|
|
5058
5058
|
return entries.map(([, c]) => prefix ? `${prefix}.${c.name}` : c.name).join(", ");
|
|
5059
5059
|
}
|
|
5060
5060
|
|
|
5061
|
-
class SelectFromBuilder {
|
|
5062
|
-
#executor;
|
|
5063
|
-
#conditions;
|
|
5064
|
-
constructor(executor, conditions = []) {
|
|
5065
|
-
this.#executor = executor;
|
|
5066
|
-
this.#conditions = conditions;
|
|
5067
|
-
}
|
|
5068
|
-
from(table) {
|
|
5069
|
-
return new SelectBuilder(this.#executor, table._.name, table, this.#conditions);
|
|
5070
|
-
}
|
|
5071
|
-
}
|
|
5072
|
-
|
|
5073
5061
|
class SelectBuilder {
|
|
5074
5062
|
#executor;
|
|
5075
5063
|
#tableName;
|
|
@@ -5748,8 +5736,7 @@ class InsertBuilder {
|
|
|
5748
5736
|
}
|
|
5749
5737
|
return records.map((r) => decodeRow(r, this.#table));
|
|
5750
5738
|
}
|
|
5751
|
-
await this.#executor.run(sql, params);
|
|
5752
|
-
return;
|
|
5739
|
+
return await this.#executor.run(sql, params);
|
|
5753
5740
|
} catch (e) {
|
|
5754
5741
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
5755
5742
|
}
|
|
@@ -5833,8 +5820,7 @@ class UpdateBuilder {
|
|
|
5833
5820
|
}
|
|
5834
5821
|
return records.map((r) => decodeRow(r, this.#table));
|
|
5835
5822
|
}
|
|
5836
|
-
await this.#executor.run(sql, params);
|
|
5837
|
-
return;
|
|
5823
|
+
return await this.#executor.run(sql, params);
|
|
5838
5824
|
} catch (e) {
|
|
5839
5825
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
5840
5826
|
}
|
|
@@ -5888,8 +5874,7 @@ class DeleteBuilder {
|
|
|
5888
5874
|
}
|
|
5889
5875
|
return records.map((r) => decodeRow(r, this.#table));
|
|
5890
5876
|
}
|
|
5891
|
-
await this.#executor.run(sql, params);
|
|
5892
|
-
return;
|
|
5877
|
+
return await this.#executor.run(sql, params);
|
|
5893
5878
|
} catch (e) {
|
|
5894
5879
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
5895
5880
|
}
|
|
@@ -5966,7 +5951,7 @@ var init_aggregates = () => {};
|
|
|
5966
5951
|
// src/flint.ts
|
|
5967
5952
|
function createClient2(executor) {
|
|
5968
5953
|
return {
|
|
5969
|
-
|
|
5954
|
+
selectFrom: (table) => new SelectBuilder(executor, table._.name, table),
|
|
5970
5955
|
insert: (table) => new InsertValuesBuilder(executor, table._.name, table),
|
|
5971
5956
|
update: (table) => new UpdateSetBuilder(executor, table._.name, table),
|
|
5972
5957
|
delete: (table) => new DeleteBuilder(executor, table._.name, table),
|
|
@@ -6033,7 +6018,8 @@ class LibsqlWebExecutor {
|
|
|
6033
6018
|
return result.rows[0] ?? null;
|
|
6034
6019
|
}
|
|
6035
6020
|
async run(sql2, params) {
|
|
6036
|
-
await this.#client.execute({ sql: sql2, args: sanitize(params) });
|
|
6021
|
+
const result = await this.#client.execute({ sql: sql2, args: sanitize(params) });
|
|
6022
|
+
return { rowsAffected: result.rowsAffected };
|
|
6037
6023
|
}
|
|
6038
6024
|
async transaction(fn) {
|
|
6039
6025
|
await this.#client.execute("BEGIN");
|
|
@@ -6192,18 +6192,6 @@ function resolveColumns(table, selectedColumns, prefix) {
|
|
|
6192
6192
|
return entries.map(([, c]) => prefix ? `${prefix}.${c.name}` : c.name).join(", ");
|
|
6193
6193
|
}
|
|
6194
6194
|
|
|
6195
|
-
class SelectFromBuilder {
|
|
6196
|
-
#executor;
|
|
6197
|
-
#conditions;
|
|
6198
|
-
constructor(executor, conditions = []) {
|
|
6199
|
-
this.#executor = executor;
|
|
6200
|
-
this.#conditions = conditions;
|
|
6201
|
-
}
|
|
6202
|
-
from(table) {
|
|
6203
|
-
return new SelectBuilder(this.#executor, table._.name, table, this.#conditions);
|
|
6204
|
-
}
|
|
6205
|
-
}
|
|
6206
|
-
|
|
6207
6195
|
class SelectBuilder {
|
|
6208
6196
|
#executor;
|
|
6209
6197
|
#tableName;
|
|
@@ -6882,8 +6870,7 @@ class InsertBuilder {
|
|
|
6882
6870
|
}
|
|
6883
6871
|
return records.map((r) => decodeRow(r, this.#table));
|
|
6884
6872
|
}
|
|
6885
|
-
await this.#executor.run(sql, params);
|
|
6886
|
-
return;
|
|
6873
|
+
return await this.#executor.run(sql, params);
|
|
6887
6874
|
} catch (e) {
|
|
6888
6875
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
6889
6876
|
}
|
|
@@ -6967,8 +6954,7 @@ class UpdateBuilder {
|
|
|
6967
6954
|
}
|
|
6968
6955
|
return records.map((r) => decodeRow(r, this.#table));
|
|
6969
6956
|
}
|
|
6970
|
-
await this.#executor.run(sql, params);
|
|
6971
|
-
return;
|
|
6957
|
+
return await this.#executor.run(sql, params);
|
|
6972
6958
|
} catch (e) {
|
|
6973
6959
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
6974
6960
|
}
|
|
@@ -7022,8 +7008,7 @@ class DeleteBuilder {
|
|
|
7022
7008
|
}
|
|
7023
7009
|
return records.map((r) => decodeRow(r, this.#table));
|
|
7024
7010
|
}
|
|
7025
|
-
await this.#executor.run(sql, params);
|
|
7026
|
-
return;
|
|
7011
|
+
return await this.#executor.run(sql, params);
|
|
7027
7012
|
} catch (e) {
|
|
7028
7013
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
7029
7014
|
}
|
|
@@ -7100,7 +7085,7 @@ var init_aggregates = () => {};
|
|
|
7100
7085
|
// src/flint.ts
|
|
7101
7086
|
function createClient2(executor) {
|
|
7102
7087
|
return {
|
|
7103
|
-
|
|
7088
|
+
selectFrom: (table) => new SelectBuilder(executor, table._.name, table),
|
|
7104
7089
|
insert: (table) => new InsertValuesBuilder(executor, table._.name, table),
|
|
7105
7090
|
update: (table) => new UpdateSetBuilder(executor, table._.name, table),
|
|
7106
7091
|
delete: (table) => new DeleteBuilder(executor, table._.name, table),
|
|
@@ -7173,7 +7158,8 @@ class LibsqlExecutor {
|
|
|
7173
7158
|
return result.rows[0] ?? null;
|
|
7174
7159
|
}
|
|
7175
7160
|
async run(sql2, params) {
|
|
7176
|
-
await this.#client.execute({ sql: sql2, args: sanitize(params) });
|
|
7161
|
+
const result = await this.#client.execute({ sql: sql2, args: sanitize(params) });
|
|
7162
|
+
return { rowsAffected: result.rowsAffected };
|
|
7177
7163
|
}
|
|
7178
7164
|
async transaction(fn) {
|
|
7179
7165
|
await this.#client.execute("BEGIN");
|
|
@@ -2493,18 +2493,6 @@ function resolveColumns(table, selectedColumns, prefix) {
|
|
|
2493
2493
|
return entries.map(([, c]) => prefix ? `${prefix}.${c.name}` : c.name).join(", ");
|
|
2494
2494
|
}
|
|
2495
2495
|
|
|
2496
|
-
class SelectFromBuilder {
|
|
2497
|
-
#executor;
|
|
2498
|
-
#conditions;
|
|
2499
|
-
constructor(executor, conditions = []) {
|
|
2500
|
-
this.#executor = executor;
|
|
2501
|
-
this.#conditions = conditions;
|
|
2502
|
-
}
|
|
2503
|
-
from(table) {
|
|
2504
|
-
return new SelectBuilder(this.#executor, table._.name, table, this.#conditions);
|
|
2505
|
-
}
|
|
2506
|
-
}
|
|
2507
|
-
|
|
2508
2496
|
class SelectBuilder {
|
|
2509
2497
|
#executor;
|
|
2510
2498
|
#tableName;
|
|
@@ -3183,8 +3171,7 @@ class InsertBuilder {
|
|
|
3183
3171
|
}
|
|
3184
3172
|
return records.map((r) => decodeRow(r, this.#table));
|
|
3185
3173
|
}
|
|
3186
|
-
await this.#executor.run(sql, params);
|
|
3187
|
-
return;
|
|
3174
|
+
return await this.#executor.run(sql, params);
|
|
3188
3175
|
} catch (e) {
|
|
3189
3176
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
3190
3177
|
}
|
|
@@ -3268,8 +3255,7 @@ class UpdateBuilder {
|
|
|
3268
3255
|
}
|
|
3269
3256
|
return records.map((r) => decodeRow(r, this.#table));
|
|
3270
3257
|
}
|
|
3271
|
-
await this.#executor.run(sql, params);
|
|
3272
|
-
return;
|
|
3258
|
+
return await this.#executor.run(sql, params);
|
|
3273
3259
|
} catch (e) {
|
|
3274
3260
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
3275
3261
|
}
|
|
@@ -3323,8 +3309,7 @@ class DeleteBuilder {
|
|
|
3323
3309
|
}
|
|
3324
3310
|
return records.map((r) => decodeRow(r, this.#table));
|
|
3325
3311
|
}
|
|
3326
|
-
await this.#executor.run(sql, params);
|
|
3327
|
-
return;
|
|
3312
|
+
return await this.#executor.run(sql, params);
|
|
3328
3313
|
} catch (e) {
|
|
3329
3314
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
3330
3315
|
}
|
|
@@ -3401,7 +3386,7 @@ var init_aggregates = () => {};
|
|
|
3401
3386
|
// src/flint.ts
|
|
3402
3387
|
function createClient(executor) {
|
|
3403
3388
|
return {
|
|
3404
|
-
|
|
3389
|
+
selectFrom: (table) => new SelectBuilder(executor, table._.name, table),
|
|
3405
3390
|
insert: (table) => new InsertValuesBuilder(executor, table._.name, table),
|
|
3406
3391
|
update: (table) => new UpdateSetBuilder(executor, table._.name, table),
|
|
3407
3392
|
delete: (table) => new DeleteBuilder(executor, table._.name, table),
|
|
@@ -3507,7 +3492,8 @@ class TursoSyncExecutor {
|
|
|
3507
3492
|
return this.#db.get(sql2, ...sanitize(params)) ?? null;
|
|
3508
3493
|
}
|
|
3509
3494
|
async run(sql2, params) {
|
|
3510
|
-
await this.#db.run(sql2, ...sanitize(params));
|
|
3495
|
+
const result = await this.#db.run(sql2, ...sanitize(params));
|
|
3496
|
+
return { rowsAffected: result.changes };
|
|
3511
3497
|
}
|
|
3512
3498
|
async transaction(fn) {
|
|
3513
3499
|
await this.#db.exec("BEGIN");
|
|
@@ -1374,18 +1374,6 @@ function resolveColumns(table, selectedColumns, prefix) {
|
|
|
1374
1374
|
return entries.map(([, c]) => prefix ? `${prefix}.${c.name}` : c.name).join(", ");
|
|
1375
1375
|
}
|
|
1376
1376
|
|
|
1377
|
-
class SelectFromBuilder {
|
|
1378
|
-
#executor;
|
|
1379
|
-
#conditions;
|
|
1380
|
-
constructor(executor, conditions = []) {
|
|
1381
|
-
this.#executor = executor;
|
|
1382
|
-
this.#conditions = conditions;
|
|
1383
|
-
}
|
|
1384
|
-
from(table) {
|
|
1385
|
-
return new SelectBuilder(this.#executor, table._.name, table, this.#conditions);
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
1377
|
class SelectBuilder {
|
|
1390
1378
|
#executor;
|
|
1391
1379
|
#tableName;
|
|
@@ -2064,8 +2052,7 @@ class InsertBuilder {
|
|
|
2064
2052
|
}
|
|
2065
2053
|
return records.map((r) => decodeRow(r, this.#table));
|
|
2066
2054
|
}
|
|
2067
|
-
await this.#executor.run(sql, params);
|
|
2068
|
-
return;
|
|
2055
|
+
return await this.#executor.run(sql, params);
|
|
2069
2056
|
} catch (e) {
|
|
2070
2057
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
2071
2058
|
}
|
|
@@ -2149,8 +2136,7 @@ class UpdateBuilder {
|
|
|
2149
2136
|
}
|
|
2150
2137
|
return records.map((r) => decodeRow(r, this.#table));
|
|
2151
2138
|
}
|
|
2152
|
-
await this.#executor.run(sql, params);
|
|
2153
|
-
return;
|
|
2139
|
+
return await this.#executor.run(sql, params);
|
|
2154
2140
|
} catch (e) {
|
|
2155
2141
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
2156
2142
|
}
|
|
@@ -2204,8 +2190,7 @@ class DeleteBuilder {
|
|
|
2204
2190
|
}
|
|
2205
2191
|
return records.map((r) => decodeRow(r, this.#table));
|
|
2206
2192
|
}
|
|
2207
|
-
await this.#executor.run(sql, params);
|
|
2208
|
-
return;
|
|
2193
|
+
return await this.#executor.run(sql, params);
|
|
2209
2194
|
} catch (e) {
|
|
2210
2195
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
2211
2196
|
}
|
|
@@ -2282,7 +2267,7 @@ var init_aggregates = () => {};
|
|
|
2282
2267
|
// src/flint.ts
|
|
2283
2268
|
function createClient(executor) {
|
|
2284
2269
|
return {
|
|
2285
|
-
|
|
2270
|
+
selectFrom: (table) => new SelectBuilder(executor, table._.name, table),
|
|
2286
2271
|
insert: (table) => new InsertValuesBuilder(executor, table._.name, table),
|
|
2287
2272
|
update: (table) => new UpdateSetBuilder(executor, table._.name, table),
|
|
2288
2273
|
delete: (table) => new DeleteBuilder(executor, table._.name, table),
|
|
@@ -2387,7 +2372,8 @@ class TursoExecutor {
|
|
|
2387
2372
|
return this.#db.get(sql2, ...sanitize(params)) ?? null;
|
|
2388
2373
|
}
|
|
2389
2374
|
async run(sql2, params) {
|
|
2390
|
-
await this.#db.run(sql2, ...sanitize(params));
|
|
2375
|
+
const result = await this.#db.run(sql2, ...sanitize(params));
|
|
2376
|
+
return { rowsAffected: result.changes };
|
|
2391
2377
|
}
|
|
2392
2378
|
async transaction(fn) {
|
|
2393
2379
|
await this.#db.exec("BEGIN");
|
package/dist/src/index.js
CHANGED
|
@@ -272,18 +272,6 @@ function resolveColumns(table, selectedColumns, prefix) {
|
|
|
272
272
|
return entries.map(([, c]) => prefix ? `${prefix}.${c.name}` : c.name).join(", ");
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
class SelectFromBuilder {
|
|
276
|
-
#executor;
|
|
277
|
-
#conditions;
|
|
278
|
-
constructor(executor, conditions = []) {
|
|
279
|
-
this.#executor = executor;
|
|
280
|
-
this.#conditions = conditions;
|
|
281
|
-
}
|
|
282
|
-
from(table) {
|
|
283
|
-
return new SelectBuilder(this.#executor, table._.name, table, this.#conditions);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
275
|
class SelectBuilder {
|
|
288
276
|
#executor;
|
|
289
277
|
#tableName;
|
|
@@ -962,8 +950,7 @@ class InsertBuilder {
|
|
|
962
950
|
}
|
|
963
951
|
return records.map((r) => decodeRow(r, this.#table));
|
|
964
952
|
}
|
|
965
|
-
await this.#executor.run(sql, params);
|
|
966
|
-
return;
|
|
953
|
+
return await this.#executor.run(sql, params);
|
|
967
954
|
} catch (e) {
|
|
968
955
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
969
956
|
}
|
|
@@ -1047,8 +1034,7 @@ class UpdateBuilder {
|
|
|
1047
1034
|
}
|
|
1048
1035
|
return records.map((r) => decodeRow(r, this.#table));
|
|
1049
1036
|
}
|
|
1050
|
-
await this.#executor.run(sql, params);
|
|
1051
|
-
return;
|
|
1037
|
+
return await this.#executor.run(sql, params);
|
|
1052
1038
|
} catch (e) {
|
|
1053
1039
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
1054
1040
|
}
|
|
@@ -1102,8 +1088,7 @@ class DeleteBuilder {
|
|
|
1102
1088
|
}
|
|
1103
1089
|
return records.map((r) => decodeRow(r, this.#table));
|
|
1104
1090
|
}
|
|
1105
|
-
await this.#executor.run(sql, params);
|
|
1106
|
-
return;
|
|
1091
|
+
return await this.#executor.run(sql, params);
|
|
1107
1092
|
} catch (e) {
|
|
1108
1093
|
throw new FlintQueryError(`Failed to execute query: ${sql}`, e);
|
|
1109
1094
|
}
|
|
@@ -1180,7 +1165,7 @@ var init_aggregates = () => {};
|
|
|
1180
1165
|
// src/flint.ts
|
|
1181
1166
|
function createClient(executor) {
|
|
1182
1167
|
return {
|
|
1183
|
-
|
|
1168
|
+
selectFrom: (table) => new SelectBuilder(executor, table._.name, table),
|
|
1184
1169
|
insert: (table) => new InsertValuesBuilder(executor, table._.name, table),
|
|
1185
1170
|
update: (table) => new UpdateSetBuilder(executor, table._.name, table),
|
|
1186
1171
|
delete: (table) => new DeleteBuilder(executor, table._.name, table),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flint-orm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"bin": {
|
|
5
5
|
"flint": "./dist/src/cli.js"
|
|
6
6
|
},
|
|
@@ -87,9 +87,17 @@
|
|
|
87
87
|
"typescript": ">=5.0.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependenciesMeta": {
|
|
90
|
-
"@libsql/client": {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
90
|
+
"@libsql/client": {
|
|
91
|
+
"optional": true
|
|
92
|
+
},
|
|
93
|
+
"@tursodatabase/database": {
|
|
94
|
+
"optional": true
|
|
95
|
+
},
|
|
96
|
+
"@tursodatabase/sync": {
|
|
97
|
+
"optional": true
|
|
98
|
+
},
|
|
99
|
+
"better-sqlite3": {
|
|
100
|
+
"optional": true
|
|
101
|
+
}
|
|
94
102
|
}
|
|
95
103
|
}
|