All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Breaking change: The return type of
Client#insert_manyandClient#insert_many_txhas been changed. Rather than returning just the number of rows inserted, it returns an array of all theInsertResultvalues for each inserted row. Unique conflicts which are skipped as duplicates are indicated in the same fashion as single inserts (theunique_skipped_as_duplicatedattribute), and in such cases the conflicting row will be returned instead. PR #38. - Breaking change: Unique jobs no longer allow total customization of their states when using the
by_stateoption. The pending, scheduled, available, and running states are required whenever customizing this list.
-
The
UniqueOptsclass gains anexclude_kindoption for cases where uniqueness needs to be guaranteed across multiple job types. -
Unique jobs utilizing
by_argscan now also opt to have a subset of the job's arguments considered for uniqueness. For example, you could choose to consider only thecustomer_idfield while ignoring the other fields:UniqueOpts(by_args=["customer_id"])
Any fields considered in uniqueness are also sorted alphabetically in order to guarantee a consistent result across implementations, even if the encoded JSON isn't sorted consistently.
-
Unique jobs have been improved to allow bulk insertion of unique jobs via
Client#insert_many.This updated implementation is significantly faster due to the removal of advisory locks in favor of an index-backed uniqueness system, while allowing some flexibility in which job states are considered. However, not all states may be removed from consideration when using the
by_stateoption; pending, scheduled, available, and running states are required whenever customizing this list.
- Now compatible with "fast path" unique job insertion that uses a unique index instead of advisory lock and fetch as introduced in River #451. PR #36.
- Various Python syntax fixes in README examples. PR #34.
UniqueOpts.by_statenow has the stronger type oflist[JobState](the enum) instead oflist[str]. PR #32.
riverqueue.AttemptErrorcan now round trip to and from JSON properly, including itsattimestamp. PR #31.
- Add doc strings for most of the public API. PR #27.
- Add
riverqueue.AttemptErrordata class to represent errors on a job row. PR #27.
- Use real enum for
JobStateinstead of many constant. This is a breaking change, but the job state constants have existed for only a short time. PR #25. riverqueue.Job's properties are now fully defined and typed. PR #26.
- Tags are now limited to 255 characters in length, and should match the regex
\A[\w][\w\-]+[\w]\z(importantly, they can't contain commas). PR #23.
- Implement
insert_manyandinsert_many_tx. PR #22.
- Rename
ArgstoJobArgsand addJobArgsWithInsertOptsprotocol. PR #20.
- Add usage instructions README, add job state constants, and change return value of
insert_many()andinsert_many_tx()to an integer instead of a list of jobs. PR #19.
- Fix
pyproject.tomldescription and add various URLs like to homepage, docs, and GitHub repositories. PR #18.
- Initial release, supporting insertion through SQLAlchemy and its underlying Postgres drivers like
psycopg2orasyncpg(for async).