Add time-based partitioning, archive operations, and set_vt method #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements four missing PGMQ features: time-based partition support, archive table operations, and visibility timeout updates.
Changes
Time-based Partitioning
create_partitioned_queue()now acceptsUnion[int, str]for intervals10000) partition bymsg_id'1 day','7 days') partition byenqueued_at_validate_partition_interval()with regex validation for PostgreSQL interval syntaxArchive Operations
read_archive(queue_name)- read single message frompgmq.a_<queue_name>read_archive_batch(queue_name, batch_size)- read multiple messagesdetach_archive(queue_name)- detach archive table from queue usingpgmq.detach_archive()Visibility Timeout Updates
set_vt(queue_name, msg_id, vt)- update message visibility timeout viapgmq.set_vt()Messageobject orNoneTesting
Added 366 tests covering all methods across multiple database drivers (pg8000, psycopg2, psycopg, psycopg2cffi, asyncpg) in both sync and async modes, including validation and error cases.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
install.python-poetry.orgcurl -sSL REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.