release: WRNexusJS 0.5.10

This commit is contained in:
2026-07-30 13:36:29 +05:30
parent 8fc6f15402
commit d1b0c55b53
159 changed files with 7509 additions and 604 deletions
+16
View File
@@ -8,12 +8,14 @@ import {
createDb,
createTableSql,
parseMigration,
applyMigrations,
migrate,
status,
rollback,
parseQueries,
generateQueriesFile,
} from "../src/index.ts";
import type { Db } from "../src/index.ts";
import { sqlite } from "../src/adapters/sqlite.ts";
import { bunSql } from "../src/adapters/bunsql.ts";
@@ -95,6 +97,20 @@ test("migration runner: parse, migrate, status, rollback", async () => {
db.close();
});
test("an empty migration set does not touch the database", async () => {
const unreachable = async () => {
throw new Error("database should remain lazy");
};
const db = {
all: unreachable,
one: unreachable,
exec: unreachable,
tx: unreachable,
} as unknown as Db;
expect(await applyMigrations(db, [])).toEqual([]);
});
test("query generator infers params and result types", () => {
const q = parseQueries(
"-- name: GetByEmail :one\nSELECT * FROM users WHERE email = :email;\n" +