@shivaedev/effect-test-sql 0.5.2 → 0.5.4
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 +12 -0
- package/dist/server/withIsolatedDatabase.d.ts +1 -1
- package/dist/server/withIsolatedDatabase.d.ts.map +1 -1
- package/dist/server/withIsolatedDatabase.js +1 -1
- package/dist/server/withIsolatedDatabase.js.map +1 -1
- package/docs/roadmap.md +9 -1
- package/package.json +3 -3
- package/src/server/withIsolatedDatabase.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.4 - 2026-10-18
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Align published framework dependencies with the current releases.
|
|
8
|
+
|
|
9
|
+
## 0.5.3 - 2026-10-18
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Close the isolated test's application scope before closing its SQL services and dropping its database.
|
|
14
|
+
|
|
3
15
|
## 0.5.2 - 2026-10-17
|
|
4
16
|
|
|
5
17
|
### Changed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { PostgresTestDatabase } from "./database.ts";
|
|
3
|
-
export declare function withIsolatedDatabase<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E | import("effect/sql/SqlError").SqlError, PostgresTestDatabase | Exclude<Exclude<R, PostgresTestDatabase | import("./database.ts").PostgresTestServices>, import("effect/Scope").Scope>>;
|
|
3
|
+
export declare function withIsolatedDatabase<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E | import("effect/sql/SqlError").SqlError, PostgresTestDatabase | Exclude<Exclude<Exclude<R, PostgresTestDatabase | import("./database.ts").PostgresTestServices>, import("effect/Scope").Scope>, import("effect/Scope").Scope>>;
|
|
4
4
|
//# sourceMappingURL=withIsolatedDatabase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIsolatedDatabase.d.ts","sourceRoot":"","sources":["../../src/server/withIsolatedDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"withIsolatedDatabase.d.ts","sourceRoot":"","sources":["../../src/server/withIsolatedDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,sPAQ3E"}
|
|
@@ -5,7 +5,7 @@ export function withIsolatedDatabase(effect) {
|
|
|
5
5
|
return Effect.scoped(Effect.gen(function* () {
|
|
6
6
|
const database = yield* PostgresTestDatabase;
|
|
7
7
|
const services = yield* database.isolated;
|
|
8
|
-
return yield* effect.pipe(Effect.provideContext(services));
|
|
8
|
+
return yield* Effect.scoped(effect.pipe(Effect.provideContext(services)));
|
|
9
9
|
})).pipe(Effect.mapError(connectionLimitHint));
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=withIsolatedDatabase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIsolatedDatabase.js","sourceRoot":"","sources":["../../src/server/withIsolatedDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACh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
|
9
9
|
- Use `migrationUpgrade` to commit an old migration prefix and apply the remaining migrations, then compare live PostgreSQL columns with an Effect SQL model using `assertModelColumns`. [Upgrade tests](../src/server/migrationUpgrade.test.ts) prove committed old data, exact column types, drift detection and invalid-state rejection; [model-column tests](../src/server/assertModelColumns.test.ts) prove model field and type comparisons.
|
|
10
10
|
- Default to two pooled connections per database, allow `maxConnections` overrides and close administrative sessions between operations. [Connection-budget tests](../src/server/connectionBudget.spec.ts) measure twelve concurrent databases with default and explicit pool sizes; [idle-cleanup tests](../src/server/postgresIdleCleanup.spec.ts) prove idle workers release their connections.
|
|
11
11
|
- Preserve SQLSTATE `53300` on connection exhaustion and add connection-limit and worker-count guidance. [Connection-limit tests](../src/server/connectionLimit.spec.ts) prove setup and wrapper diagnostics against PostgreSQL and preserve other SQL failures' identity.
|
|
12
|
-
- Check public contracts with [compiler tests](../src/server/postgres.typecheck.test.ts), [migration-step compiler tests](../src/server/migrationSteps.typecheck.test.ts), [upgrade compiler tests](../src/server/migrationUpgrade.typecheck.test.ts) and
|
|
12
|
+
- Check public contracts with [compiler tests](../src/server/postgres.typecheck.test.ts), [migration-step compiler tests](../src/server/migrationSteps.typecheck.test.ts), [upgrade compiler tests](../src/server/migrationUpgrade.typecheck.test.ts) and [packed-consumer checks](../../../script/package-check/fixtures/effect-test-sql/types.ts.txt).
|
|
13
|
+
|
|
14
|
+
## Next
|
|
15
|
+
|
|
16
|
+
No additional package work is selected. Let application migration and test-isolation needs identify the next change.
|
|
17
|
+
|
|
18
|
+
## Open questions
|
|
19
|
+
|
|
20
|
+
No package scope questions are currently selected.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/effect-test-sql",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "PostgreSQL rollback and real-commit test isolation for Effect",
|
|
5
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/effect-test-sql#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"README.md"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@shivaedev/effect-sql": "0.5.
|
|
46
|
+
"@shivaedev/effect-sql": "0.5.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@effect/sql-pg": "4.0.4",
|
|
50
50
|
"@effect/vitest": "4.0.4",
|
|
51
51
|
"@shivaedev/effect-test": "0.5.0",
|
|
52
52
|
"@shivaedev/quality": "0.23.0",
|
|
53
|
-
"@shivaedev/test-story": "0.
|
|
53
|
+
"@shivaedev/test-story": "0.6.0",
|
|
54
54
|
"@types/node": "24.19.2",
|
|
55
55
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
56
56
|
"effect": "4.0.4",
|
|
@@ -7,7 +7,7 @@ export function withIsolatedDatabase<A, E, R>(effect: Effect.Effect<A, E, R>) {
|
|
|
7
7
|
Effect.gen(function* () {
|
|
8
8
|
const database = yield* PostgresTestDatabase;
|
|
9
9
|
const services = yield* database.isolated;
|
|
10
|
-
return yield* effect.pipe(Effect.provideContext(services));
|
|
10
|
+
return yield* Effect.scoped(effect.pipe(Effect.provideContext(services)));
|
|
11
11
|
}),
|
|
12
12
|
).pipe(Effect.mapError(connectionLimitHint));
|
|
13
13
|
}
|