riverqueue 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/docs/migrations.md +6 -4
- data/lib/migration_cli.rb +19 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e49226e1e557c7e5560d30616e5297f943b632cca65369169086f84ee5e507d9
|
|
4
|
+
data.tar.gz: 3e0a98d8c1efb5687fe34f76af27d36d7b0117c1e572fb36a0d4457bd53d36b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4f2d7c811449d299dfc3599dee25eb0f70d19e95d715966ee075bc5eaac514cb44f7eb7419072b181cc7719594bb8344168ddc4f3b1a7eba2f025b7bc505d6a
|
|
7
|
+
data.tar.gz: 06ab9c8b0d08d82473ddda057d2e91167c7f8f979f73097c68565115e644110867b1665a6b1ec89672dd3a3b00377b698227bbb6c3abdd93aba301ebee830da9
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.16.1] - 2026-11-09
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Accept `sqlite:` and `sqlite://` URLs with both Active Record and Sequel, including `:memory:` databases, while preserving the `sqlite3:` aliases. [PR #1588](https://github.com/riverqueue/river/pull/1588).
|
|
15
|
+
- Reject empty SQLite paths in commands that connect to a database; bare prefixes remain valid for offline migration SQL export. [PR #1588](https://github.com/riverqueue/river/pull/1588).
|
|
16
|
+
|
|
10
17
|
## [0.16.0] - 2026-11-04
|
|
11
18
|
|
|
12
19
|
### Added
|
|
@@ -15,8 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
22
|
|
|
16
23
|
### Fixed
|
|
17
24
|
|
|
18
|
-
- Reduce database overhead in the Active Record and Sequel drivers: use `RETURNING` to avoid redundant row fetches, claim batches and clean up finalized jobs in one statement, and omit unnecessary transactions. Return Active Record connections to the pool after operations and avoid allocating models for job reads. Avoid slow Postgres fetching-index scans for updates and deletes targeting a job by ID when state statistics are stale. [PR #1574](https://github.com/riverqueue/river/pull/1574).
|
|
19
|
-
- Prevent ordinary job wakeups from interrupting maintenance error backoff and causing rapid retries during persistent failures. [PR #1574](https://github.com/riverqueue/river/pull/1574).
|
|
25
|
+
- Reduce database overhead in the Active Record and Sequel drivers: use `RETURNING` to avoid redundant row fetches, claim batches and clean up finalized jobs in one statement, and omit unnecessary transactions. Return Active Record connections to the pool after operations and avoid allocating models for job reads. Avoid slow Postgres fetching-index scans for updates and deletes targeting a job by ID when state statistics are stale. Thanks [@jpcamara](https://github.com/jpcamara) for the original performance investigation and proposed fixes in [PR #1566](https://github.com/riverqueue/river/pull/1566). [PR #1574](https://github.com/riverqueue/river/pull/1574).
|
|
26
|
+
- Prevent ordinary job wakeups from interrupting maintenance error backoff and causing rapid retries during persistent failures. Thanks [@jpcamara](https://github.com/jpcamara) for the original proposed fix in [PR #1566](https://github.com/riverqueue/river/pull/1566). [PR #1574](https://github.com/riverqueue/river/pull/1574).
|
|
20
27
|
- Enforce the 32 MiB encoded UTF-8 JSON limit for `Job#output=`, preserving previous output when validation fails. [PR #1569](https://github.com/riverqueue/river/pull/1569).
|
|
21
28
|
|
|
22
29
|
## [0.15.0] - 2026-10-30
|
data/docs/migrations.md
CHANGED
|
@@ -18,12 +18,14 @@ Create the database first, then run:
|
|
|
18
18
|
bundle exec river migrate-status --database-url postgres://localhost/my_app
|
|
19
19
|
bundle exec river migrate-up --database-url postgres://localhost/my_app
|
|
20
20
|
|
|
21
|
-
# SQLite, using
|
|
21
|
+
# SQLite, using either driver:
|
|
22
22
|
bundle exec river migrate-up --database-url sqlite://storage/river.sqlite3
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
`DATABASE_URL` supplies the URL when `--database-url` is omitted.
|
|
26
|
-
|
|
25
|
+
`DATABASE_URL` supplies the URL when `--database-url` is omitted. Both drivers
|
|
26
|
+
accept `sqlite://path`, `sqlite:path`, and the `sqlite3:` aliases. For an in-memory
|
|
27
|
+
database, use `sqlite::memory:` or `sqlite://:memory:`. See the shared
|
|
28
|
+
[SQLite URL reference](../../docs/sqlite-urls.md) for path handling. To target an existing
|
|
27
29
|
Postgres schema, pass `--schema jobs`; otherwise the connection's current
|
|
28
30
|
schema is used. Schema names must be simple SQL identifiers. SQLite always
|
|
29
31
|
uses its main schema.
|
|
@@ -91,7 +93,7 @@ migration-tracking table and can usually be omitted with another framework.
|
|
|
91
93
|
Preserve version boundaries and apply each migration in its own transaction.
|
|
92
94
|
|
|
93
95
|
Export defaults to Postgres and ignores `DATABASE_URL`. Use
|
|
94
|
-
`--database-url sqlite://` (
|
|
96
|
+
`--database-url sqlite:` or `sqlite://` (including the `sqlite3:` aliases) to select SQLite SQL; the URL is only
|
|
95
97
|
a dialect hint. `--schema jobs` qualifies Postgres objects with that schema.
|
|
96
98
|
Without it, objects are unqualified. Schema placeholders are always substituted.
|
|
97
99
|
|
data/lib/migration_cli.rb
CHANGED
|
@@ -56,16 +56,32 @@ module River
|
|
|
56
56
|
raise ArgumentError, "down migrations may delete data; pass --yes to confirm"
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
sqlite_path = url.sub(/\Asqlite3?:/i, "").delete_prefix("//") if url.match?(/\Asqlite3?:/i)
|
|
60
|
+
raise ArgumentError, "SQLite database URL needs a path or `:memory:`" if sqlite_path == ""
|
|
60
61
|
|
|
62
|
+
adapter = detect_driver
|
|
61
63
|
if adapter == "activerecord"
|
|
62
64
|
require "riverqueue-activerecord"
|
|
63
65
|
active_record_base = Object.const_get("ActiveRecord::Base")
|
|
64
|
-
|
|
66
|
+
connection = if sqlite_path == ":memory:"
|
|
67
|
+
{adapter: "sqlite3", database: sqlite_path}
|
|
68
|
+
elsif sqlite_path
|
|
69
|
+
"sqlite3:#{sqlite_path}"
|
|
70
|
+
else
|
|
71
|
+
url
|
|
72
|
+
end
|
|
73
|
+
active_record_base.establish_connection(connection)
|
|
65
74
|
driver = River::Driver.const_get(:ActiveRecord).new
|
|
66
75
|
else
|
|
67
76
|
require "riverqueue-sequel"
|
|
68
|
-
|
|
77
|
+
connection = if sqlite_path == ":memory:"
|
|
78
|
+
{adapter: "sqlite", database: sqlite_path}
|
|
79
|
+
elsif sqlite_path
|
|
80
|
+
"sqlite://#{sqlite_path}"
|
|
81
|
+
else
|
|
82
|
+
url
|
|
83
|
+
end
|
|
84
|
+
database = Object.const_get(:Sequel).connect(connection)
|
|
69
85
|
driver = River::Driver.const_get(:Sequel).new(database)
|
|
70
86
|
end
|
|
71
87
|
|