Make sure GenKind utils are backward compatible & don't generate loops (#2625)

Co-authored-by: Tim <hello@timsmart.co>
This commit is contained in:
Michael Arnaldi
2024-04-26 12:39:59 +02:00
committed by GitHub
co-authored by Tim
parent 027418edaa
commit ffe4f4e95d
18 changed files with 158 additions and 69 deletions
+4 -4
View File
@@ -31,8 +31,8 @@ describe("Client", () => {
it.scoped("withTransaction", () =>
Effect.gen(function*() {
const sql = yield* makeClient
yield sql`CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT)`
yield sql.withTransaction(sql`INSERT INTO test (name) VALUES ('hello')`)
yield* sql`CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT)`
yield* sql.withTransaction(sql`INSERT INTO test (name) VALUES ('hello')`)
const rows = yield* sql`SELECT * FROM test`
assert.deepStrictEqual(rows, [{ id: 1, name: "hello" }])
}))
@@ -40,8 +40,8 @@ describe("Client", () => {
it.scoped("withTransaction rollback", () =>
Effect.gen(function*() {
const sql = yield* makeClient
yield sql`CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT)`
yield sql`INSERT INTO test (name) VALUES ('hello')`.pipe(
yield* sql`CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT)`
yield* sql`INSERT INTO test (name) VALUES ('hello')`.pipe(
Effect.andThen(Effect.fail("boom")),
sql.withTransaction,
Effect.ignore