@coffre/db 0.1.11 → 0.1.12

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
@@ -8,6 +8,13 @@
8
8
  "when": 1790930587507,
9
9
  "tag": "0000_baseline",
10
10
  "breakpoints": true
11
+ },
12
+ {
13
+ "idx": 1,
14
+ "version": "7",
15
+ "when": 1791062292678,
16
+ "tag": "0001_remove_syncs",
17
+ "breakpoints": true
11
18
  }
12
19
  ]
13
20
  }
@@ -0,0 +1,13 @@
1
+ -- The migrator's transaction holds the SQLite write lock through this guard
2
+ -- and both drops. Failure rolls back the entire migration.
3
+ CREATE TABLE coffre_sync_removal_guard (
4
+ records INTEGER CONSTRAINT syncs_must_be_cleared_before_upgrade CHECK (records = 0)
5
+ );
6
+ --> statement-breakpoint
7
+ INSERT INTO coffre_sync_removal_guard SELECT (SELECT count(*) FROM syncs) + (SELECT count(*) FROM sync_keys);
8
+ --> statement-breakpoint
9
+ DROP TABLE coffre_sync_removal_guard;
10
+ --> statement-breakpoint
11
+ DROP TABLE sync_keys;
12
+ --> statement-breakpoint
13
+ DROP TABLE syncs;