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
River CLI Postgres commands had fixed session defaults and no explicit
flag for statement timeout. For long-running migrations, callers either
accepted the default or had to encode `statement_timeout` into the
connection string. This could be difficult in deployed environments
where i.e. a database connection string was shared with an application
and the user did not want to accidentally affect timeouts for other
processes using a shared connection string.
This commit adds a root `--statement-timeout` flag and thread it through
command bootstrapping into Postgres pool configuration. Statement
timeout now uses explicit precedence: flag value first, then
connection-string query parameter, then built-in default.
`idle_in_transaction_session_timeout` keeps its existing behavior and
remains URL/default driven.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@ 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
+
- Added root River CLI flag `--statement-timeout` so Postgres session statement timeout can be set explicitly for commands like migrations. Explicit flag values take priority over database URL query params, and query params still take priority over built-in defaults. [PR #XXXX](https://github.com/riverqueue/river/pull/XXXX).
13
+
10
14
### Fixed
11
15
12
16
-`JobCountByQueueAndState` now returns consistent results across drivers, including requested queues with zero jobs, and deduplicates repeated queue names in input. This resolves an issue with the sqlite driver in River UI reported in [riverqueue/riverui#496](https://github.com/riverqueue/riverui#496). [PR #1140](https://github.com/riverqueue/river/pull/1140).
Copy file name to clipboardExpand all lines: docs/development.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,11 @@ To run programs locally outside of tests, create and raise a development databas
30
30
createdb river_dev
31
31
go run ./cmd/river migrate-up --database-url postgres:///river_dev --line main
32
32
33
+
If needed, override Postgres timeouts for long-running migrations with root CLI
34
+
flags:
35
+
36
+
go run ./cmd/river --statement-timeout 2m migrate-up --database-url postgres:///river_dev --line main
37
+
33
38
## Releasing a new version
34
39
35
40
1. Fetch changes to the repo and any new tags. Export `VERSION` by incrementing the last tag. Execute `update-mod-version` to add it the project's `go.mod` files:
@@ -71,4 +76,4 @@ Modify `go.work` so it contains the new desired version in `go` and/or `toolchai
0 commit comments