Admin API¶
The Admin API provides queue management, schema administration, and monitoring capabilities.
Usage¶
Schema Management¶
install¶
Install the pgqrs schema (tables, indexes, constraints). It is idempotent and safe to call multiple times.
For s3://... DSNs, install() bootstraps the remote SQLite object if it does not exist yet. If remote state already exists, bootstrap returns a conflict instead of overwriting it.
verify¶
Verify that the pgqrs schema is correctly installed. Returns/Raises error if schema is missing.
For S3-backed queues, verification runs against the current local view of the store. In Rust, call snapshot() first if you need to refresh from remote state before verifying.
uninstall¶
Remove the pgqrs schema (tables and data).
Danger
This permanently deletes all queues, messages, workers, and archives!
Queue Management¶
create_queue¶
Create a new queue.
Returns QueueInfo:
| Field | Type | Description |
|---|---|---|
id |
i64/int |
Unique queue ID |
queue_name |
String/str |
Queue name |
created_at |
DateTime/str |
Creation timestamp |
get_queue¶
Get a queue by name.
delete_queue¶
Delete a queue and all its messages.
Metrics & Monitoring¶
queue_metrics¶
Get metrics for a specific queue.
Table APIs¶
Admin provides direct access to table operations.
Queues Table¶
Workers Table¶
Messages Table¶
Archived Messages¶
Archived messages live in pgqrs_messages with archived_at set. Use the Messages table APIs to query archived items.