@coffre/db 0.1.11 → 0.1.13

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.
Files changed (33) hide show
  1. package/dist/connect.d.ts +1 -1
  2. package/dist/{database-BhLco7OA.d.ts → database-CNMfHZwF.d.ts} +1 -1
  3. package/dist/dialect.d.ts +1 -1
  4. package/dist/hyperdrive.d.ts +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/log.d.ts +1 -1
  7. package/dist/migrations/postgres/0001_remove_syncs.sql +13 -0
  8. package/dist/migrations/postgres/meta/0001_snapshot.json +1707 -0
  9. package/dist/migrations/postgres/meta/_journal.json +7 -0
  10. package/dist/migrations/sqlite/0001_remove_syncs.sql +13 -0
  11. package/dist/migrations/sqlite/meta/0001_snapshot.json +1575 -0
  12. package/dist/migrations/sqlite/meta/_journal.json +7 -0
  13. package/dist/portable.d.ts +2 -2
  14. package/dist/{relations-DqgxtlKu.js → relations-BfR3JjT1.js} +2 -22
  15. package/dist/{schema-Cd4WOnB5.d.ts → schema-AmvM6w0D.d.ts} +2 -362
  16. package/dist/schema-sqlite.d.ts +1 -369
  17. package/dist/schema-sqlite.js +5 -59
  18. package/dist/schema-version.d.ts +5 -3
  19. package/dist/schema-version.js +4 -2
  20. package/dist/schema.d.ts +2 -2
  21. package/dist/schema.js +5 -79
  22. package/package.json +2 -2
  23. package/src/baseline.ts +11 -19
  24. package/src/migrations/postgres/0001_remove_syncs.sql +13 -0
  25. package/src/migrations/postgres/meta/0001_snapshot.json +1707 -0
  26. package/src/migrations/postgres/meta/_journal.json +7 -0
  27. package/src/migrations/sqlite/0001_remove_syncs.sql +13 -0
  28. package/src/migrations/sqlite/meta/0001_snapshot.json +1575 -0
  29. package/src/migrations/sqlite/meta/_journal.json +7 -0
  30. package/src/relations.ts +1 -14
  31. package/src/schema-version.ts +4 -2
  32. package/src/schema.sqlite.ts +1 -65
  33. package/src/schema.ts +1 -81
package/dist/connect.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Database } from "./database-BhLco7OA.js";
1
+ import { t as Database } from "./database-CNMfHZwF.js";
2
2
  import { Engine } from "./dialect.js";
3
3
  import { ClientConfig } from "pg";
4
4
  //#region src/postgres.d.ts
@@ -1,4 +1,4 @@
1
- import { l as schema_d_exports } from "./schema-Cd4WOnB5.js";
1
+ import { l as schema_d_exports } from "./schema-AmvM6w0D.js";
2
2
  import { Table } from "drizzle-orm";
3
3
  import { NodePgDatabase } from "drizzle-orm/node-postgres";
4
4
  import pg from "pg";
package/dist/dialect.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as Queryable } from "./database-BhLco7OA.js";
1
+ import { i as Queryable } from "./database-CNMfHZwF.js";
2
2
  import { SQL } from "drizzle-orm";
3
3
  import { PgTable } from "drizzle-orm/pg-core";
4
4
  //#region src/dialect.d.ts
@@ -1,4 +1,4 @@
1
- import { n as PoolLike } from "./database-BhLco7OA.js";
1
+ import { n as PoolLike } from "./database-CNMfHZwF.js";
2
2
  import pg from "pg";
3
3
  //#region src/hyperdrive.d.ts
4
4
  /** Postgres through a Hyperdrive binding: `postgres(env.HYPERDRIVE)`. */
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { l as schema_d_exports } from "./schema-Cd4WOnB5.js";
2
- import { a as Transaction, c as tablesOf, i as Queryable, n as PoolLike, o as createDatabase, r as QueryOutsideTransaction, s as own, t as Database } from "./database-BhLco7OA.js";
1
+ import { l as schema_d_exports } from "./schema-AmvM6w0D.js";
2
+ import { a as Transaction, c as tablesOf, i as Queryable, n as PoolLike, o as createDatabase, r as QueryOutsideTransaction, s as own, t as Database } from "./database-CNMfHZwF.js";
3
3
  export { Database, PoolLike, QueryOutsideTransaction, Queryable, Transaction, createDatabase, own, schema_d_exports as schema, tablesOf };
package/dist/log.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Transaction } from "./database-BhLco7OA.js";
1
+ import { a as Transaction } from "./database-CNMfHZwF.js";
2
2
  import { LogKey } from "@coffre/core/audit";
3
3
  //#region src/log.d.ts
4
4
  /**
@@ -0,0 +1,13 @@
1
+ -- Stop old app instances before upgrading. Never silently discard a configured
2
+ -- destination, including archived ones. Keep the audit and sealed legacy rows.
3
+ LOCK TABLE syncs, sync_keys IN ACCESS EXCLUSIVE MODE;
4
+ --> statement-breakpoint
5
+ DO $$ BEGIN
6
+ IF EXISTS (SELECT 1 FROM syncs) OR EXISTS (SELECT 1 FROM sync_keys) THEN
7
+ RAISE EXCEPTION 'syncs are removed: migrate destinations to service tokens, back up and clear syncs and sync_keys before upgrading';
8
+ END IF;
9
+ END $$;
10
+ --> statement-breakpoint
11
+ DROP TABLE sync_keys;
12
+ --> statement-breakpoint
13
+ DROP TABLE syncs;