Added behavior journal, adjusted layout, and added some colors
Deploy / deploy-prod (push) Skipped
Deploy / deploy-dev (push) Successful in 4m18s

This commit is contained in:
Corey Blais committed 2026-10-05 15:20:00 -04:00
1 parent b1b89ad334
commit 3237cd7601
31 files changed
+2135 -275

No files matched your search

+15
View File
@@ -23,6 +23,21 @@ export class DatabaseClient {
return this.pool.query<T>(text, params);
}
async transaction<T>(operation: (client: pg.PoolClient) => Promise<T>): Promise<T> {
const client = await this.pool.connect();
try {
await client.query('BEGIN');
const result = await operation(client);
await client.query('COMMIT');
return result;
} catch (error) {
await client.query('ROLLBACK');
throw error;
} finally {
client.release();
}
}
async close() {
await this.pool.end();
}