Fix tests

This commit is contained in:
Alex Gleason 2023-10-11 23:50:11 -05:00
parent 079cdcf7d7
commit 1b8a2d764c
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 2 additions and 2 deletions

View File

@ -8,8 +8,8 @@ function setPragma(db: Kysely<any>, pragma: string, value: string | number) {
/** Get value of PRAGMA from the database. */
async function getPragma(db: Kysely<any>, pragma: string) {
const result = await sql.raw(`PRAGMA ${pragma}`).execute(db);
const row = result.rows[0] as Record<string, unknown>;
return row[pragma];
const row = result.rows[0] as Record<string, unknown> | undefined;
return row?.[pragma];
}
export { getPragma, setPragma };