@beignet/cli 0.0.13 → 0.0.15

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,1001 +0,0 @@
1
- // The starter ships its initial Drizzle migration inside the template so the
2
- // first run is `db migrate` with no generate step. `dbSchema` and the
3
- // `starterMigration*` files below pair together — regenerate together.
4
- //
5
- // To regenerate: scaffold a scratch app with `dbSchema` as
6
- // infra/db/schema/index.ts plus `drizzleConfig` as drizzle.config.ts, run
7
- // `drizzle-kit generate --name starter` with the drizzle-kit version pinned in
8
- // externalVersions, then paste drizzle/0000_starter.sql,
9
- // drizzle/meta/_journal.json, and drizzle/meta/0000_snapshot.json back here
10
- // verbatim.
11
- const files = {
12
- drizzleConfig: `export default {
13
- schema: "./infra/db/schema/index.ts",
14
- out: "./drizzle",
15
- dialect: "sqlite",
16
- dbCredentials: {
17
- url: process.env.SQLITE_DB_URL ?? "file:local.db",
18
- authToken: process.env.SQLITE_DB_AUTH_TOKEN,
19
- },
20
- };
21
- `,
22
- dbSchema: `import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
23
-
24
- export const user = sqliteTable("user", {
25
- id: text("id").primaryKey(),
26
- name: text("name").notNull(),
27
- email: text("email").notNull().unique(),
28
- emailVerified: integer("email_verified", { mode: "boolean" })
29
- .notNull()
30
- .default(false),
31
- image: text("image"),
32
- createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
33
- updatedAt: integer("updated_at", { mode: "timestamp" }).notNull(),
34
- });
35
-
36
- export const session = sqliteTable("session", {
37
- id: text("id").primaryKey(),
38
- expiresAt: integer("expires_at", { mode: "timestamp" }).notNull(),
39
- token: text("token").notNull().unique(),
40
- createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
41
- updatedAt: integer("updated_at", { mode: "timestamp" }).notNull(),
42
- ipAddress: text("ip_address"),
43
- userAgent: text("user_agent"),
44
- userId: text("user_id")
45
- .notNull()
46
- .references(() => user.id, { onDelete: "cascade" }),
47
- });
48
-
49
- export const account = sqliteTable("account", {
50
- id: text("id").primaryKey(),
51
- accountId: text("account_id").notNull(),
52
- providerId: text("provider_id").notNull(),
53
- userId: text("user_id")
54
- .notNull()
55
- .references(() => user.id, { onDelete: "cascade" }),
56
- accessToken: text("access_token"),
57
- refreshToken: text("refresh_token"),
58
- idToken: text("id_token"),
59
- accessTokenExpiresAt: integer("access_token_expires_at", {
60
- mode: "timestamp",
61
- }),
62
- refreshTokenExpiresAt: integer("refresh_token_expires_at", {
63
- mode: "timestamp",
64
- }),
65
- scope: text("scope"),
66
- password: text("password"),
67
- createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
68
- updatedAt: integer("updated_at", { mode: "timestamp" }).notNull(),
69
- });
70
-
71
- export const verification = sqliteTable("verification", {
72
- id: text("id").primaryKey(),
73
- identifier: text("identifier").notNull(),
74
- value: text("value").notNull(),
75
- expiresAt: integer("expires_at", { mode: "timestamp" }).notNull(),
76
- createdAt: integer("created_at", { mode: "timestamp" }),
77
- updatedAt: integer("updated_at", { mode: "timestamp" }),
78
- });
79
-
80
- export const todos = sqliteTable(
81
- "todos",
82
- {
83
- id: text("id").primaryKey(),
84
- userId: text("user_id")
85
- .notNull()
86
- .references(() => user.id, { onDelete: "cascade" }),
87
- title: text("title").notNull(),
88
- completed: integer("completed", { mode: "boolean" })
89
- .notNull()
90
- .default(false),
91
- createdAt: text("created_at").notNull(),
92
- },
93
- (table) => ({
94
- userIdx: index("todos_user_idx").on(table.userId, table.createdAt),
95
- }),
96
- );
97
-
98
- export const idempotencyRecords = sqliteTable(
99
- "idempotency_records",
100
- {
101
- storageKey: text("storage_key").primaryKey(),
102
- namespace: text("namespace").notNull(),
103
- idempotencyKey: text("idempotency_key").notNull(),
104
- scopeKey: text("scope_key").notNull(),
105
- fingerprint: text("fingerprint").notNull(),
106
- status: text("status", { enum: ["in-progress", "completed"] }).notNull(),
107
- resultJson: text("result_json"),
108
- reservedAt: text("reserved_at").notNull(),
109
- completedAt: text("completed_at"),
110
- expiresAt: text("expires_at"),
111
- updatedAt: text("updated_at").notNull(),
112
- },
113
- (table) => ({
114
- lookupIdx: index("idempotency_records_lookup_idx").on(
115
- table.namespace,
116
- table.scopeKey,
117
- table.idempotencyKey,
118
- ),
119
- expiresIdx: index("idempotency_records_expires_idx").on(table.expiresAt),
120
- }),
121
- );
122
- `,
123
- drizzleTodoRepository: `import type { beignetServerOnly } from "@beignet/core/server-only";
124
- import { offsetPageResult } from "@beignet/core/pagination";
125
- import type { DrizzleSqliteDatabase } from "@beignet/provider-db-drizzle/sqlite";
126
- import { count, desc, eq } from "drizzle-orm";
127
- import type {
128
- NewTodo,
129
- TodoRepository,
130
- UpdateTodoData,
131
- } from "@/features/todos/ports";
132
- import type { Todo } from "@/features/todos/schemas";
133
- import * as schema from "@/infra/db/schema";
134
-
135
- type TodoRow = typeof schema.todos.$inferSelect;
136
-
137
- function toTodo(row: TodoRow): Todo {
138
- return {
139
- id: row.id,
140
- userId: row.userId,
141
- title: row.title,
142
- completed: row.completed,
143
- createdAt: row.createdAt,
144
- };
145
- }
146
-
147
- export function createDrizzleTodoRepository(
148
- db: DrizzleSqliteDatabase<typeof schema>,
149
- ): TodoRepository {
150
- return {
151
- async list(userId, page) {
152
- const rows = await db
153
- .select()
154
- .from(schema.todos)
155
- .where(eq(schema.todos.userId, userId))
156
- .orderBy(desc(schema.todos.createdAt))
157
- .limit(page.limit)
158
- .offset(page.offset);
159
- const [{ total }] = await db
160
- .select({ total: count() })
161
- .from(schema.todos)
162
- .where(eq(schema.todos.userId, userId));
163
-
164
- return offsetPageResult(rows.map(toTodo), page, total);
165
- },
166
- async findById(id: string) {
167
- const [row] = await db
168
- .select()
169
- .from(schema.todos)
170
- .where(eq(schema.todos.id, id))
171
- .limit(1);
172
-
173
- return row ? toTodo(row) : null;
174
- },
175
- async create(input: NewTodo) {
176
- const todo = {
177
- id: crypto.randomUUID(),
178
- userId: input.userId,
179
- title: input.title,
180
- completed: false,
181
- createdAt: new Date().toISOString(),
182
- };
183
- const [row] = await db.insert(schema.todos).values(todo).returning();
184
-
185
- if (!row) {
186
- throw new Error("Failed to create todo");
187
- }
188
-
189
- return toTodo(row);
190
- },
191
- async update(id: string, input: UpdateTodoData) {
192
- const [row] = await db
193
- .update(schema.todos)
194
- .set({ completed: input.completed })
195
- .where(eq(schema.todos.id, id))
196
- .returning();
197
-
198
- if (!row) {
199
- throw new Error(\`Failed to update todo \${id}\`);
200
- }
201
-
202
- return toTodo(row);
203
- },
204
- async delete(id: string) {
205
- await db.delete(schema.todos).where(eq(schema.todos.id, id));
206
- },
207
- };
208
- }
209
- `,
210
- dbRepositories: `import type { DrizzleSqliteDatabase } from "@beignet/provider-db-drizzle/sqlite";
211
- import { createDrizzleTodoRepository } from "@/infra/todos/drizzle-todo-repository";
212
- import type { AppTransactionPorts } from "@/ports";
213
- import * as schema from "./schema";
214
-
215
- export function createRepositories(
216
- db: DrizzleSqliteDatabase<typeof schema>,
217
- ): Omit<AppTransactionPorts, "idempotency"> {
218
- return {
219
- todos: createDrizzleTodoRepository(db),
220
- };
221
- }
222
- `,
223
- databaseReady: `import type { Client } from "@libsql/client";
224
- import { drizzle } from "drizzle-orm/libsql";
225
- import { migrate } from "drizzle-orm/libsql/migrator";
226
-
227
- let ready: Promise<void> | undefined;
228
-
229
- /**
230
- * Make sure the database is usable before the first query runs.
231
- *
232
- * In development, pending migrations from \`drizzle/\` are applied
233
- * automatically so a fresh clone works without remembering
234
- * \`beignet db migrate\`. In production the schema is never mutated;
235
- * an unmigrated database fails loudly with the command to run.
236
- *
237
- * Memoized per process. Next.js collects page data in parallel workers
238
- * that can all reach this at once, so the busy timeout makes concurrent
239
- * SQLite access wait instead of failing with SQLITE_BUSY.
240
- */
241
- export function ensureDatabaseReady(client: Client): Promise<void> {
242
- ready ??= prepare(client);
243
- return ready;
244
- }
245
-
246
- async function prepare(client: Client): Promise<void> {
247
- await client.execute("PRAGMA busy_timeout = 5000");
248
-
249
- if (process.env.NODE_ENV === "production") {
250
- const tables = await client.execute(
251
- "SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'user' LIMIT 1",
252
- );
253
- if (tables.rows.length === 0) {
254
- throw new Error(
255
- "Database has no tables yet. Run \`beignet db migrate\` against this database before starting the app.",
256
- );
257
- }
258
- return;
259
- }
260
-
261
- await migrate(drizzle(client), { migrationsFolder: "drizzle" });
262
- }
263
- `,
264
- dbProvider: `import type { beignetServerOnly } from "@beignet/core/server-only";
265
- import { createProvider } from "@beignet/core/providers";
266
- import {
267
- createDrizzleSqliteIdempotencyPort,
268
- createDrizzleSqliteUnitOfWork,
269
- type DbPort,
270
- } from "@beignet/provider-db-drizzle/sqlite";
271
- import type { AppPorts } from "@/ports";
272
- import { ensureDatabaseReady } from "./database-ready";
273
- import { createRepositories } from "./repositories";
274
- import type * as schema from "./schema";
275
-
276
- export const starterDatabaseProvider = createProvider<{
277
- db: DbPort<typeof schema>;
278
- }>()({
279
- name: "starter-database",
280
-
281
- async setup({ ports }) {
282
- const dbPort = ports.db;
283
- if (!dbPort) {
284
- throw new Error(
285
- "starterDatabaseProvider requires a db port. Register createDrizzleSqliteProvider({ schema }) before it.",
286
- );
287
- }
288
-
289
- const repositories = createRepositories(dbPort.db);
290
- const idempotency = createDrizzleSqliteIdempotencyPort(dbPort.db);
291
-
292
- const providedPorts: Pick<AppPorts, "idempotency" | "todos" | "uow"> = {
293
- ...repositories,
294
- idempotency,
295
- uow: createDrizzleSqliteUnitOfWork({
296
- db: dbPort.db,
297
- createTransactionPorts: (tx) => ({
298
- ...createRepositories(tx),
299
- idempotency: createDrizzleSqliteIdempotencyPort(tx),
300
- }),
301
- }),
302
- };
303
-
304
- return {
305
- ports: providedPorts,
306
- async start() {
307
- await ensureDatabaseReady(dbPort.client);
308
- },
309
- };
310
- },
311
- });
312
- `,
313
- dbReset: `import { createClient } from "@libsql/client";
314
- import { drizzle } from "drizzle-orm/libsql";
315
- import { migrate } from "drizzle-orm/libsql/migrator";
316
- import { env } from "@/lib/env";
317
-
318
- if (
319
- !env.SQLITE_DB_URL.startsWith("file:") &&
320
- process.env.BEIGNET_ALLOW_DATABASE_RESET !== "true"
321
- ) {
322
- throw new Error(
323
- "Refusing to reset a non-local database. Set BEIGNET_ALLOW_DATABASE_RESET=true if this is intentional.",
324
- );
325
- }
326
-
327
- const tables = [
328
- "verification",
329
- "account",
330
- "session",
331
- "todos",
332
- "user",
333
- "idempotency_records",
334
- "__drizzle_migrations",
335
- ] as const;
336
-
337
- const client = createClient({
338
- url: env.SQLITE_DB_URL,
339
- authToken: env.SQLITE_DB_AUTH_TOKEN,
340
- });
341
-
342
- try {
343
- await client.execute("PRAGMA foreign_keys = OFF");
344
- try {
345
- for (const table of tables) {
346
- await client.execute(\`DROP TABLE IF EXISTS \${table}\`);
347
- }
348
- } finally {
349
- await client.execute("PRAGMA foreign_keys = ON");
350
- }
351
-
352
- await migrate(drizzle(client), { migrationsFolder: "drizzle" });
353
- console.log("Database reset.");
354
- } finally {
355
- client.close();
356
- }
357
- `,
358
- dbTestDatabase: `import { existsSync, unlinkSync } from "node:fs";
359
- import { tmpdir } from "node:os";
360
- import { join } from "node:path";
361
- import { type Client, createClient } from "@libsql/client";
362
- import { drizzle, type LibSQLDatabase } from "drizzle-orm/libsql";
363
- import { migrate } from "drizzle-orm/libsql/migrator";
364
- import { createRepositories } from "./repositories";
365
- import * as schema from "./schema";
366
-
367
- export type TestDatabase = {
368
- client: Client;
369
- db: LibSQLDatabase<typeof schema>;
370
- repositories: ReturnType<typeof createRepositories>;
371
- path: string;
372
- close(): Promise<void>;
373
- };
374
-
375
- export async function createTestDatabase(): Promise<TestDatabase> {
376
- const path = join(tmpdir(), "beignet-test-" + crypto.randomUUID() + ".db");
377
- const client = createClient({ url: "file:" + path });
378
- const db = drizzle(client, { schema });
379
- await migrate(db, { migrationsFolder: "drizzle" });
380
-
381
- return {
382
- client,
383
- db,
384
- repositories: createRepositories(db),
385
- path,
386
- close: async () => {
387
- client.close();
388
- if (existsSync(path)) {
389
- unlinkSync(path);
390
- }
391
- },
392
- };
393
- }
394
- `,
395
- // Generated by drizzle-kit generate --name starter against dbSchema above.
396
- starterMigrationSql: `CREATE TABLE \`account\` (
397
- \`id\` text PRIMARY KEY NOT NULL,
398
- \`account_id\` text NOT NULL,
399
- \`provider_id\` text NOT NULL,
400
- \`user_id\` text NOT NULL,
401
- \`access_token\` text,
402
- \`refresh_token\` text,
403
- \`id_token\` text,
404
- \`access_token_expires_at\` integer,
405
- \`refresh_token_expires_at\` integer,
406
- \`scope\` text,
407
- \`password\` text,
408
- \`created_at\` integer NOT NULL,
409
- \`updated_at\` integer NOT NULL,
410
- FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON UPDATE no action ON DELETE cascade
411
- );
412
- --> statement-breakpoint
413
- CREATE TABLE \`idempotency_records\` (
414
- \`storage_key\` text PRIMARY KEY NOT NULL,
415
- \`namespace\` text NOT NULL,
416
- \`idempotency_key\` text NOT NULL,
417
- \`scope_key\` text NOT NULL,
418
- \`fingerprint\` text NOT NULL,
419
- \`status\` text NOT NULL,
420
- \`result_json\` text,
421
- \`reserved_at\` text NOT NULL,
422
- \`completed_at\` text,
423
- \`expires_at\` text,
424
- \`updated_at\` text NOT NULL
425
- );
426
- --> statement-breakpoint
427
- CREATE INDEX \`idempotency_records_lookup_idx\` ON \`idempotency_records\` (\`namespace\`,\`scope_key\`,\`idempotency_key\`);--> statement-breakpoint
428
- CREATE INDEX \`idempotency_records_expires_idx\` ON \`idempotency_records\` (\`expires_at\`);--> statement-breakpoint
429
- CREATE TABLE \`session\` (
430
- \`id\` text PRIMARY KEY NOT NULL,
431
- \`expires_at\` integer NOT NULL,
432
- \`token\` text NOT NULL,
433
- \`created_at\` integer NOT NULL,
434
- \`updated_at\` integer NOT NULL,
435
- \`ip_address\` text,
436
- \`user_agent\` text,
437
- \`user_id\` text NOT NULL,
438
- FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON UPDATE no action ON DELETE cascade
439
- );
440
- --> statement-breakpoint
441
- CREATE UNIQUE INDEX \`session_token_unique\` ON \`session\` (\`token\`);--> statement-breakpoint
442
- CREATE TABLE \`todos\` (
443
- \`id\` text PRIMARY KEY NOT NULL,
444
- \`user_id\` text NOT NULL,
445
- \`title\` text NOT NULL,
446
- \`completed\` integer DEFAULT false NOT NULL,
447
- \`created_at\` text NOT NULL,
448
- FOREIGN KEY (\`user_id\`) REFERENCES \`user\`(\`id\`) ON UPDATE no action ON DELETE cascade
449
- );
450
- --> statement-breakpoint
451
- CREATE INDEX \`todos_user_idx\` ON \`todos\` (\`user_id\`,\`created_at\`);--> statement-breakpoint
452
- CREATE TABLE \`user\` (
453
- \`id\` text PRIMARY KEY NOT NULL,
454
- \`name\` text NOT NULL,
455
- \`email\` text NOT NULL,
456
- \`email_verified\` integer DEFAULT false NOT NULL,
457
- \`image\` text,
458
- \`created_at\` integer NOT NULL,
459
- \`updated_at\` integer NOT NULL
460
- );
461
- --> statement-breakpoint
462
- CREATE UNIQUE INDEX \`user_email_unique\` ON \`user\` (\`email\`);--> statement-breakpoint
463
- CREATE TABLE \`verification\` (
464
- \`id\` text PRIMARY KEY NOT NULL,
465
- \`identifier\` text NOT NULL,
466
- \`value\` text NOT NULL,
467
- \`expires_at\` integer NOT NULL,
468
- \`created_at\` integer,
469
- \`updated_at\` integer
470
- );
471
- `,
472
- starterMigrationJournal: `{
473
- "version": "7",
474
- "dialect": "sqlite",
475
- "entries": [
476
- {
477
- "idx": 0,
478
- "version": "6",
479
- "when": 1781185557868,
480
- "tag": "0000_starter",
481
- "breakpoints": true
482
- }
483
- ]
484
- }`,
485
- starterMigrationSnapshot: `{
486
- "version": "6",
487
- "dialect": "sqlite",
488
- "id": "5131bbf1-cff0-42de-a5f4-298187fdafd1",
489
- "prevId": "00000000-0000-0000-0000-000000000000",
490
- "tables": {
491
- "account": {
492
- "name": "account",
493
- "columns": {
494
- "id": {
495
- "name": "id",
496
- "type": "text",
497
- "primaryKey": true,
498
- "notNull": true,
499
- "autoincrement": false
500
- },
501
- "account_id": {
502
- "name": "account_id",
503
- "type": "text",
504
- "primaryKey": false,
505
- "notNull": true,
506
- "autoincrement": false
507
- },
508
- "provider_id": {
509
- "name": "provider_id",
510
- "type": "text",
511
- "primaryKey": false,
512
- "notNull": true,
513
- "autoincrement": false
514
- },
515
- "user_id": {
516
- "name": "user_id",
517
- "type": "text",
518
- "primaryKey": false,
519
- "notNull": true,
520
- "autoincrement": false
521
- },
522
- "access_token": {
523
- "name": "access_token",
524
- "type": "text",
525
- "primaryKey": false,
526
- "notNull": false,
527
- "autoincrement": false
528
- },
529
- "refresh_token": {
530
- "name": "refresh_token",
531
- "type": "text",
532
- "primaryKey": false,
533
- "notNull": false,
534
- "autoincrement": false
535
- },
536
- "id_token": {
537
- "name": "id_token",
538
- "type": "text",
539
- "primaryKey": false,
540
- "notNull": false,
541
- "autoincrement": false
542
- },
543
- "access_token_expires_at": {
544
- "name": "access_token_expires_at",
545
- "type": "integer",
546
- "primaryKey": false,
547
- "notNull": false,
548
- "autoincrement": false
549
- },
550
- "refresh_token_expires_at": {
551
- "name": "refresh_token_expires_at",
552
- "type": "integer",
553
- "primaryKey": false,
554
- "notNull": false,
555
- "autoincrement": false
556
- },
557
- "scope": {
558
- "name": "scope",
559
- "type": "text",
560
- "primaryKey": false,
561
- "notNull": false,
562
- "autoincrement": false
563
- },
564
- "password": {
565
- "name": "password",
566
- "type": "text",
567
- "primaryKey": false,
568
- "notNull": false,
569
- "autoincrement": false
570
- },
571
- "created_at": {
572
- "name": "created_at",
573
- "type": "integer",
574
- "primaryKey": false,
575
- "notNull": true,
576
- "autoincrement": false
577
- },
578
- "updated_at": {
579
- "name": "updated_at",
580
- "type": "integer",
581
- "primaryKey": false,
582
- "notNull": true,
583
- "autoincrement": false
584
- }
585
- },
586
- "indexes": {},
587
- "foreignKeys": {
588
- "account_user_id_user_id_fk": {
589
- "name": "account_user_id_user_id_fk",
590
- "tableFrom": "account",
591
- "tableTo": "user",
592
- "columnsFrom": [
593
- "user_id"
594
- ],
595
- "columnsTo": [
596
- "id"
597
- ],
598
- "onDelete": "cascade",
599
- "onUpdate": "no action"
600
- }
601
- },
602
- "compositePrimaryKeys": {},
603
- "uniqueConstraints": {},
604
- "checkConstraints": {}
605
- },
606
- "idempotency_records": {
607
- "name": "idempotency_records",
608
- "columns": {
609
- "storage_key": {
610
- "name": "storage_key",
611
- "type": "text",
612
- "primaryKey": true,
613
- "notNull": true,
614
- "autoincrement": false
615
- },
616
- "namespace": {
617
- "name": "namespace",
618
- "type": "text",
619
- "primaryKey": false,
620
- "notNull": true,
621
- "autoincrement": false
622
- },
623
- "idempotency_key": {
624
- "name": "idempotency_key",
625
- "type": "text",
626
- "primaryKey": false,
627
- "notNull": true,
628
- "autoincrement": false
629
- },
630
- "scope_key": {
631
- "name": "scope_key",
632
- "type": "text",
633
- "primaryKey": false,
634
- "notNull": true,
635
- "autoincrement": false
636
- },
637
- "fingerprint": {
638
- "name": "fingerprint",
639
- "type": "text",
640
- "primaryKey": false,
641
- "notNull": true,
642
- "autoincrement": false
643
- },
644
- "status": {
645
- "name": "status",
646
- "type": "text",
647
- "primaryKey": false,
648
- "notNull": true,
649
- "autoincrement": false
650
- },
651
- "result_json": {
652
- "name": "result_json",
653
- "type": "text",
654
- "primaryKey": false,
655
- "notNull": false,
656
- "autoincrement": false
657
- },
658
- "reserved_at": {
659
- "name": "reserved_at",
660
- "type": "text",
661
- "primaryKey": false,
662
- "notNull": true,
663
- "autoincrement": false
664
- },
665
- "completed_at": {
666
- "name": "completed_at",
667
- "type": "text",
668
- "primaryKey": false,
669
- "notNull": false,
670
- "autoincrement": false
671
- },
672
- "expires_at": {
673
- "name": "expires_at",
674
- "type": "text",
675
- "primaryKey": false,
676
- "notNull": false,
677
- "autoincrement": false
678
- },
679
- "updated_at": {
680
- "name": "updated_at",
681
- "type": "text",
682
- "primaryKey": false,
683
- "notNull": true,
684
- "autoincrement": false
685
- }
686
- },
687
- "indexes": {
688
- "idempotency_records_lookup_idx": {
689
- "name": "idempotency_records_lookup_idx",
690
- "columns": [
691
- "namespace",
692
- "scope_key",
693
- "idempotency_key"
694
- ],
695
- "isUnique": false
696
- },
697
- "idempotency_records_expires_idx": {
698
- "name": "idempotency_records_expires_idx",
699
- "columns": [
700
- "expires_at"
701
- ],
702
- "isUnique": false
703
- }
704
- },
705
- "foreignKeys": {},
706
- "compositePrimaryKeys": {},
707
- "uniqueConstraints": {},
708
- "checkConstraints": {}
709
- },
710
- "session": {
711
- "name": "session",
712
- "columns": {
713
- "id": {
714
- "name": "id",
715
- "type": "text",
716
- "primaryKey": true,
717
- "notNull": true,
718
- "autoincrement": false
719
- },
720
- "expires_at": {
721
- "name": "expires_at",
722
- "type": "integer",
723
- "primaryKey": false,
724
- "notNull": true,
725
- "autoincrement": false
726
- },
727
- "token": {
728
- "name": "token",
729
- "type": "text",
730
- "primaryKey": false,
731
- "notNull": true,
732
- "autoincrement": false
733
- },
734
- "created_at": {
735
- "name": "created_at",
736
- "type": "integer",
737
- "primaryKey": false,
738
- "notNull": true,
739
- "autoincrement": false
740
- },
741
- "updated_at": {
742
- "name": "updated_at",
743
- "type": "integer",
744
- "primaryKey": false,
745
- "notNull": true,
746
- "autoincrement": false
747
- },
748
- "ip_address": {
749
- "name": "ip_address",
750
- "type": "text",
751
- "primaryKey": false,
752
- "notNull": false,
753
- "autoincrement": false
754
- },
755
- "user_agent": {
756
- "name": "user_agent",
757
- "type": "text",
758
- "primaryKey": false,
759
- "notNull": false,
760
- "autoincrement": false
761
- },
762
- "user_id": {
763
- "name": "user_id",
764
- "type": "text",
765
- "primaryKey": false,
766
- "notNull": true,
767
- "autoincrement": false
768
- }
769
- },
770
- "indexes": {
771
- "session_token_unique": {
772
- "name": "session_token_unique",
773
- "columns": [
774
- "token"
775
- ],
776
- "isUnique": true
777
- }
778
- },
779
- "foreignKeys": {
780
- "session_user_id_user_id_fk": {
781
- "name": "session_user_id_user_id_fk",
782
- "tableFrom": "session",
783
- "tableTo": "user",
784
- "columnsFrom": [
785
- "user_id"
786
- ],
787
- "columnsTo": [
788
- "id"
789
- ],
790
- "onDelete": "cascade",
791
- "onUpdate": "no action"
792
- }
793
- },
794
- "compositePrimaryKeys": {},
795
- "uniqueConstraints": {},
796
- "checkConstraints": {}
797
- },
798
- "todos": {
799
- "name": "todos",
800
- "columns": {
801
- "id": {
802
- "name": "id",
803
- "type": "text",
804
- "primaryKey": true,
805
- "notNull": true,
806
- "autoincrement": false
807
- },
808
- "user_id": {
809
- "name": "user_id",
810
- "type": "text",
811
- "primaryKey": false,
812
- "notNull": true,
813
- "autoincrement": false
814
- },
815
- "title": {
816
- "name": "title",
817
- "type": "text",
818
- "primaryKey": false,
819
- "notNull": true,
820
- "autoincrement": false
821
- },
822
- "completed": {
823
- "name": "completed",
824
- "type": "integer",
825
- "primaryKey": false,
826
- "notNull": true,
827
- "autoincrement": false,
828
- "default": false
829
- },
830
- "created_at": {
831
- "name": "created_at",
832
- "type": "text",
833
- "primaryKey": false,
834
- "notNull": true,
835
- "autoincrement": false
836
- }
837
- },
838
- "indexes": {
839
- "todos_user_idx": {
840
- "name": "todos_user_idx",
841
- "columns": [
842
- "user_id",
843
- "created_at"
844
- ],
845
- "isUnique": false
846
- }
847
- },
848
- "foreignKeys": {
849
- "todos_user_id_user_id_fk": {
850
- "name": "todos_user_id_user_id_fk",
851
- "tableFrom": "todos",
852
- "tableTo": "user",
853
- "columnsFrom": [
854
- "user_id"
855
- ],
856
- "columnsTo": [
857
- "id"
858
- ],
859
- "onDelete": "cascade",
860
- "onUpdate": "no action"
861
- }
862
- },
863
- "compositePrimaryKeys": {},
864
- "uniqueConstraints": {},
865
- "checkConstraints": {}
866
- },
867
- "user": {
868
- "name": "user",
869
- "columns": {
870
- "id": {
871
- "name": "id",
872
- "type": "text",
873
- "primaryKey": true,
874
- "notNull": true,
875
- "autoincrement": false
876
- },
877
- "name": {
878
- "name": "name",
879
- "type": "text",
880
- "primaryKey": false,
881
- "notNull": true,
882
- "autoincrement": false
883
- },
884
- "email": {
885
- "name": "email",
886
- "type": "text",
887
- "primaryKey": false,
888
- "notNull": true,
889
- "autoincrement": false
890
- },
891
- "email_verified": {
892
- "name": "email_verified",
893
- "type": "integer",
894
- "primaryKey": false,
895
- "notNull": true,
896
- "autoincrement": false,
897
- "default": false
898
- },
899
- "image": {
900
- "name": "image",
901
- "type": "text",
902
- "primaryKey": false,
903
- "notNull": false,
904
- "autoincrement": false
905
- },
906
- "created_at": {
907
- "name": "created_at",
908
- "type": "integer",
909
- "primaryKey": false,
910
- "notNull": true,
911
- "autoincrement": false
912
- },
913
- "updated_at": {
914
- "name": "updated_at",
915
- "type": "integer",
916
- "primaryKey": false,
917
- "notNull": true,
918
- "autoincrement": false
919
- }
920
- },
921
- "indexes": {
922
- "user_email_unique": {
923
- "name": "user_email_unique",
924
- "columns": [
925
- "email"
926
- ],
927
- "isUnique": true
928
- }
929
- },
930
- "foreignKeys": {},
931
- "compositePrimaryKeys": {},
932
- "uniqueConstraints": {},
933
- "checkConstraints": {}
934
- },
935
- "verification": {
936
- "name": "verification",
937
- "columns": {
938
- "id": {
939
- "name": "id",
940
- "type": "text",
941
- "primaryKey": true,
942
- "notNull": true,
943
- "autoincrement": false
944
- },
945
- "identifier": {
946
- "name": "identifier",
947
- "type": "text",
948
- "primaryKey": false,
949
- "notNull": true,
950
- "autoincrement": false
951
- },
952
- "value": {
953
- "name": "value",
954
- "type": "text",
955
- "primaryKey": false,
956
- "notNull": true,
957
- "autoincrement": false
958
- },
959
- "expires_at": {
960
- "name": "expires_at",
961
- "type": "integer",
962
- "primaryKey": false,
963
- "notNull": true,
964
- "autoincrement": false
965
- },
966
- "created_at": {
967
- "name": "created_at",
968
- "type": "integer",
969
- "primaryKey": false,
970
- "notNull": false,
971
- "autoincrement": false
972
- },
973
- "updated_at": {
974
- "name": "updated_at",
975
- "type": "integer",
976
- "primaryKey": false,
977
- "notNull": false,
978
- "autoincrement": false
979
- }
980
- },
981
- "indexes": {},
982
- "foreignKeys": {},
983
- "compositePrimaryKeys": {},
984
- "uniqueConstraints": {},
985
- "checkConstraints": {}
986
- }
987
- },
988
- "views": {},
989
- "enums": {},
990
- "_meta": {
991
- "schemas": {},
992
- "tables": {},
993
- "columns": {}
994
- },
995
- "internal": {
996
- "indexes": {}
997
- }
998
- }`,
999
- };
1000
- export { files as dbFiles };
1001
- //# sourceMappingURL=db.js.map