Move app to apps/web-react in pnpm workspace layout

This commit is contained in:
Kalle
2026-08-16 09:20:33 +03:00
parent 7e365ccfcf
commit bbc8ea57af
2913 changed files with 227 additions and 250 deletions

View File

@@ -0,0 +1,24 @@
import type { DBBoolean } from "~/db/tables";
/** Converts a JS boolean to the 0/1 representation SQLite stores booleans as. */
export function toDBBoolean(value: boolean): DBBoolean {
return value ? 1 : 0;
}
export function errorIsSqliteForeignKeyConstraintFailure(
error: unknown,
): error is Error {
return (
error instanceof Error &&
error?.message?.includes("FOREIGN KEY constraint failed")
);
}
export function errorIsSqliteUniqueConstraintFailure(
error: unknown,
): error is Error {
return (
error instanceof Error &&
error?.message?.includes("UNIQUE constraint failed")
);
}