@shivaedev/sql 0.43.0 → 0.44.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.44.0 - 2026-11-06
4
+
5
+ ### Breaking
6
+
7
+ - Import `MIGRATIONS_DIRECTORY` and `MIGRATION_FILE_PATTERN` from `@shivaedev/sql/migration.ts` instead of `@shivaedev/sql/migrationConvention.ts`.
8
+
3
9
  ## 0.43.0 - 2026-11-05
4
10
 
5
11
  ### Breaking
package/README.md CHANGED
@@ -957,7 +957,7 @@ const migrateOrders = migratePostgres({
957
957
 
958
958
  Use sequential numbers, not timestamps. Effect's Migrator skips any migration whose ID is not greater than the latest applied ID. A timestamped migration from a branch that merges late could therefore be silently skipped by native Migrator on an already-migrated database. Two branches that choose the same sequential number instead fail loudly with Effect's duplicate-ID `MigrationError` (`kind: "Duplicates"`), forcing the second branch to renumber and re-check. This package also rejects gaps below the latest applied ID, as described below.
959
959
 
960
- `migrationConvention.ts` exports `MIGRATIONS_DIRECTORY` and `MIGRATION_FILE_PATTERN` so template packaging and repository quality configuration share the folder and filename convention.
960
+ `migration.ts` exports `MIGRATIONS_DIRECTORY` and `MIGRATION_FILE_PATTERN` so template packaging and repository quality configuration share the folder and filename convention.
961
961
 
962
962
  `migratePostgres` rejects loaded migration IDs at or below the latest applied ID that are missing from the ledger with a typed native `MigrationError` (`kind: "BadState"`) naming those IDs. It also rejects a loaded ID recorded under a different name, matching readiness's ID and name checks. Both checks run before any new migration body, schema component or release publication. Later ledger entries absent from the loader are allowed for older releases.
963
963
 
@@ -1018,7 +1018,7 @@ Import the module that defines the name; there is no root entry.
1018
1018
  - `@shivaedev/sql/transact.ts`: `transact(effect, options)` or `effect.pipe(transact(options))` — Required `onSqlError` mapper; requires `SqlClient` and `Reactivity`.
1019
1019
  - `@shivaedev/sql/transact.ts`: `invalidateOnCommit(keys, options?)` — Records keys for its client, or invalidates immediately outside a transaction.
1020
1020
  - `@shivaedev/sql/advisoryXactLock.ts`: `advisoryXactLock(key)`, `AdvisoryLockOutsideTransaction` — PostgreSQL transaction lock on a bigint or string hashed with `hashtextextended(key, 0)`; requires an active transaction on the current `SqlClient`.
1021
- - `@shivaedev/sql/migrationConvention.ts`: `MIGRATIONS_DIRECTORY`, `MIGRATION_FILE_PATTERN` — Application folder and four-digit sequential snake_case TypeScript filename pattern.
1021
+ - `@shivaedev/sql/migration.ts`: `MIGRATIONS_DIRECTORY`, `MIGRATION_FILE_PATTERN` — Application folder and four-digit sequential snake_case TypeScript filename pattern.
1022
1022
  - `@shivaedev/sql/migrationsFromDirectory.ts`: `migrationsFromDirectory(root)` — Discover migrations under the application root with native `FileSystem` and `Path`.
1023
1023
  - `@shivaedev/sql/migrations.ts`: `migratePostgres(options)` — Native loader, required `lockTimeout`, optional `components`, `release` and ledger `table`, default `effect_sql_migrations`.
1024
1024
  - `@shivaedev/sql/backfillPostgres.ts`: `backfillPostgres({ batchSize, lock, loadProgress, select, process, saveProgress })` — Bounded transactions with application-owned checkpoints; returns the rows processed in this invocation. `BackfillInsideTransaction` rejects an enclosing transaction.
@@ -1,3 +1,3 @@
1
1
  export declare const MIGRATIONS_DIRECTORY = "src/server/migrations";
2
2
  export declare const MIGRATION_FILE_PATTERN: RegExp;
3
- //# sourceMappingURL=migrationConvention.d.ts.map
3
+ //# sourceMappingURL=migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../src/migration.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,sBAAsB,QAAkD,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export const MIGRATIONS_DIRECTORY = "src/server/migrations";
2
2
  export const MIGRATION_FILE_PATTERN = /^[0-9]{4}_[a-z][a-z0-9]*(?:_[a-z0-9]+)*\.ts$/u;
3
- //# sourceMappingURL=migrationConvention.js.map
3
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.js","sourceRoot":"","sources":["../src/migration.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAC5D,MAAM,CAAC,MAAM,sBAAsB,GAAG,+CAA+C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { Effect, Path } from "effect";
2
2
  import * as MigratorFileSystem from "effect/sql/MigratorFileSystem";
3
- import { MIGRATIONS_DIRECTORY } from "#migrationConvention.ts";
3
+ import { MIGRATIONS_DIRECTORY } from "#migration.ts";
4
4
  export function migrationsFromDirectory(root) {
5
5
  return Effect.flatMap(Path.Path, (path) => MigratorFileSystem.fromFileSystem(path.join(root, MIGRATIONS_DIRECTORY)));
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"migrationsFromDirectory.js","sourceRoot":"","sources":["../src/migrationsFromDirectory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,kBAAkB,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,UAAU,uBAAuB,CAAC,IAAY;IACnD,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACtH,CAAC"}
1
+ {"version":3,"file":"migrationsFromDirectory.js","sourceRoot":"","sources":["../src/migrationsFromDirectory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,kBAAkB,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,UAAU,uBAAuB,CAAC,IAAY;IACnD,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACtH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/sql",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "description": "Schema-derived repositories over native Effect SQL",
5
5
  "keywords": [
6
6
  "effect"
@@ -50,12 +50,12 @@
50
50
  "@effect/platform-node": "4.1.0",
51
51
  "@effect/sql-pg": "4.1.0",
52
52
  "@effect/sql-sqlite-node": "4.1.0",
53
- "@shivaedev/contract": "0.40.0",
54
- "@shivaedev/jobs": "0.40.0",
55
- "@shivaedev/quality": "0.66.0",
56
- "@shivaedev/test-kits": "0.8.1",
57
- "@shivaedev/test-sql": "0.24.1",
58
- "@shivaedev/test-story": "0.42.1",
53
+ "@shivaedev/contract": "0.41.0",
54
+ "@shivaedev/jobs": "0.40.1",
55
+ "@shivaedev/quality": "0.67.0",
56
+ "@shivaedev/test-kits": "0.9.0",
57
+ "@shivaedev/test-sql": "0.24.2",
58
+ "@shivaedev/test-story": "0.43.0",
59
59
  "@types/node": "24.19.2",
60
60
  "effect": "4.1.0",
61
61
  "typescript": "7.0.2",
@@ -1,6 +1,6 @@
1
1
  import { Effect, Path } from "effect";
2
2
  import * as MigratorFileSystem from "effect/sql/MigratorFileSystem";
3
- import { MIGRATIONS_DIRECTORY } from "#migrationConvention.ts";
3
+ import { MIGRATIONS_DIRECTORY } from "#migration.ts";
4
4
 
5
5
  export function migrationsFromDirectory(root: string) {
6
6
  return Effect.flatMap(Path.Path, (path) => MigratorFileSystem.fromFileSystem(path.join(root, MIGRATIONS_DIRECTORY)));
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrationConvention.d.ts","sourceRoot":"","sources":["../src/migrationConvention.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,sBAAsB,QAAkD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrationConvention.js","sourceRoot":"","sources":["../src/migrationConvention.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAC5D,MAAM,CAAC,MAAM,sBAAsB,GAAG,+CAA+C,CAAC"}
File without changes