diff options
Diffstat (limited to 'packages/db')
| -rw-r--r-- | packages/db/index.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/db/index.ts b/packages/db/index.ts index 433d8db2..b86665d2 100644 --- a/packages/db/index.ts +++ b/packages/db/index.ts @@ -1,3 +1,17 @@ +import Database from "better-sqlite3"; +import { ExtractTablesWithRelations } from "drizzle-orm"; +import { SQLiteTransaction } from "drizzle-orm/sqlite-core"; + +import * as schema from "./schema"; + export { db } from "./drizzle"; export * as schema from "./schema"; export { SqliteError } from "better-sqlite3"; + +// This is exported here to avoid leaking better-sqlite types outside of this package. +export type HoarderDBTransaction = SQLiteTransaction< + "sync", + Database.RunResult, + typeof schema, + ExtractTablesWithRelations<typeof schema> +>; |
