Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/NikolayS/PgQue/llms.txt

Use this file to discover all available pages before exploring further.

PgQue is SQL-first: any Postgres driver can call pgque.* functions directly. The three first-party client libraries are thin, idiomatic wrappers over those SQL primitives — they do not add a network layer or a separate daemon. All three are published at v0.2.0-rc.1 and expose the same core operations: send, receive, ack, nack, force_next_tick, and a high-level Consumer that manages the poll loop for you.

Capability parity matrix

CapabilityPythonGoTypeScript
connect / close
Raw SQL escape hatch✓ (conn)✓ (Pool())✓ (rawPool)
PgQue-classified errors
Lossless PostgreSQL bigint IDs✓ (int)✓ (int64)✓ (bigint)
send
send_batch / SendBatch / sendBatch
receive
ack returns SQL rowcount (0 stale, 1 success)✓ (int)✓ (int64)✓ (number)
nack
force_next_tick / ForceNextTick / forceNextTick
nack retry delay + reason options
High-level Consumer
Consumer wakeup modelpolling + optional LISTEN/NOTIFY wakeuppollingpolling
Consumer poll interval option
Consumer max-messages option
Consumer retry delay option
Unknown-type behavior avoids silent ack
Configurable unknown-type policy
subscribe / unsubscribe wrappers
Cooperative consumers (experimental)
Legend: ✓ supported by the client API; ✗ not exposed as a first-class client API. Lower-level SQL primitives remain available through each client’s raw connection/pool escape hatch. TypeScript exposes extra convenience wrappers for ticker; Python and Go can call it via raw SQL.
Apps that both produce and consume must be granted both pgque_reader and pgque_writer — they are siblings, not parent/child roles.
grant pgque_reader to your_app_user;
grant pgque_writer to your_app_user;

Choose a client

Python

pgque-py — psycopg 3. Synchronous polling consumer with optional LISTEN/NOTIFY wakeup.

Go

pgque-go — pgx/v5 + pgxpool. Transparent autocommit; idiomatic typed errors.

TypeScript

pgque — node-postgres (pg). Lossless bigint IDs; AbortSignal-driven consumer.

Any language

Because PgQue is SQL-first, you can use any Postgres driver without a dedicated library:
select pgque.send('orders', '{"order_id": 42}'::jsonb);

-- advance the queue (omit when a ticker is running via pg_cron)
select pgque.force_next_tick('orders');
select pgque.ticker();

-- receive returns rows; every row carries the same batch_id
select * from pgque.receive('orders', 'processor', 100);

-- ack the batch_id from any returned row
select pgque.ack(1);

Build docs developers (and LLMs) love