You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, add a partial implementation for SQLite, specifically the driver
operations for `river_migration`, `river_leader`, `river_queue`, and
most of `river_job` (currently missing the two worst queries). Getting
to a fully functional SQLite driver has turned out to be a huge project,
so I'm kind of hoping this change can get our foot in the door so to
speak, and then let me iterate to a fully functional SQLite driver
incrementally.
The main reason this turned out to be quite an effort is that SQLite,
although nominally supporting a lot of the same syntax Postgres does,
just has a lot of unexpected limitations and quirks that all need to be
tracked down separately and a workaround added. For example:
* SQLite doesn't really have data types. Everything is either an
integer, real, text, or blob, and anything more sophisticated just has
to be shoehorned into one of these types. For example, there's no
boolean. Despite the fanfare recently, there isn't even a jsonb. Jsonb
gets pushed into a blob.
* The most annoying missing data type is a timestamp. Date/times are
stored as either Unix integers or strings, and SQLite provides a
number of obnoxious, error-prone, built-ins to work with them.
* No arrays.
* No modification operations in CTEs. (Although counting my lucky stars
that CTEs are supported at least.)
* No listen/notify.
Aside from that though, we had to get some testing infrastructure in
place, and our testing has traditionally been quite affixed to Postgres,
which would've made a lot of changes necessary. However, the schema
additions in #848 do help to make this quite a bit easier with the
driver-based `TestSchema` and `TestTx` functions, and because they raise
schema automatically, it doesn't complicate test setup instructions in
any way by adding extra steps.
A few caveats:
* I've found that the combination of SQLite's reduced capabilities +
sqlc's bugginess [1] make bit batch insert/update operations basically
impossible (I tried every workaround I could possibly thin of), so
these are done in loops of individual operations instead. I *think*
this is okay for now though. For one, sqlc will hopefully get these
limitations fixed eventually, and for two, SQLite databases will often
be running locally, meaning the round trip cost per operation is much
lower than what we'd see in a hosted Postgres somewhere.
* It's not totally clear that having a SQLite implementation will be
"worth it enough" in the long run given that it will add some
difficulty to non-trivial future database-related operations. My hope
is that as it's in a prerelease state, we can gauge how bad it is to
keep up to date. If it feels like way more effort than it's worth, we
can still axe it before it ever becomes a functional driver.
[1] sqlc-dev/sqlc#3802 (comment)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Added
11
+
12
+
- Preliminary River driver for SQLite (`riverdriver/riversqlite`). This driver is not yet complete and no attempt should be made to use it yet because it won't work. Implementation is ongoing. [PR #870](https://github.com/riverqueue/river/pull/870).
13
+
10
14
### Changed
11
15
12
16
- Job kinds must comply to a format of `\A[\w][\w\-\[\]<>\/.·:+]+\z`, mainly in an attempt to eliminate commas and spaces to make format more predictable for an upcoming search UI. This check can be disabled for now using `Config.SkipJobKindValidation`, but this option will likely be removed in a future version of River. [PR #879](https://github.com/riverqueue/river/pull/879).
13
17
18
+
### Fixed
19
+
20
+
- Resuming an already unpaused queue is now fully an no-op, and won't touch the row's `updated_at` like it (unintentionally) did before. [PR #870](https://github.com/riverqueue/river/pull/870).
21
+
14
22
## [0.21.0] - 2025-05-02
15
23
16
24
⚠️ Internal APIs used for communication between River and River Pro have changed. If using River Pro, make sure to update River and River Pro to latest at the same time to get compatible versions. River v0.21.0 is compatible with River Pro v0.13.0.
0 commit comments