Runs a SQL query with positional parameters ($1, $2, ...).
$1
$2
Wrap the transaction of the library your app uses, so that Hermes stores messages in it. pg clients (PoolClient, Client) and TypeORM's QueryRunner satisfy it as they are.
pg
PoolClient
Client
QueryRunner
// node-postgresconst client = await pool.connect()await client.query('BEGIN')await outbox.queue(event, { tx: client })await client.query('COMMIT')// Prismaawait prisma.$transaction(async (tx) => { await outbox.queue(event, { tx: { query: (text, params) => tx.$executeRawUnsafe(text, ...params) } })}) Copy
// node-postgresconst client = await pool.connect()await client.query('BEGIN')await outbox.queue(event, { tx: client })await client.query('COMMIT')// Prismaawait prisma.$transaction(async (tx) => { await outbox.queue(event, { tx: { query: (text, params) => tx.$executeRawUnsafe(text, ...params) } })})
Runs a SQL query with positional parameters (
$1,$2, ...).Wrap the transaction of the library your app uses, so that Hermes stores messages in it.
pgclients (PoolClient,Client) and TypeORM'sQueryRunnersatisfy it as they are.Example