import type { Db as DbInterface } from 'pg-boss';
import type { db } from '~/lib/db';
class PgBossDrizzleTransactionAdapter implements DbInterface {
tx: Parameters<Parameters<db['transaction']>[0]>[0];
constructor(tx: Parameters<Parameters<db['transaction']>[0]>[0]) {
this.tx = tx;
}
executeSql(text: string, values: any[]): Promise<{ rows: any[] }> {
return this.tx.execute(text, values);
}
}
import type { Db as DbInterface } from 'pg-boss';
import type { db } from '~/lib/db';
class PgBossDrizzleTransactionAdapter implements DbInterface {
tx: Parameters<Parameters<db['transaction']>[0]>[0];
constructor(tx: Parameters<Parameters<db['transaction']>[0]>[0]) {
this.tx = tx;
}
executeSql(text: string, values: any[]): Promise<{ rows: any[] }> {
return this.tx.execute(text, values);
}
}