From 09af4c4e9672d73029c2e176842ffea183436814 Mon Sep 17 00:00:00 2001 From: Brandur Date: Thu, 8 Oct 2026 00:54:50 -0500 Subject: [PATCH] Prefer use of "Postgres" over "PostgreSQL" in docs I just noticed while reading our Rust crate's README that the use of "PostgreSQL" in documentation is a dead to rights giveaway that everything is LLM-written. There's no correct form of "Postgres" versus "PostgreSQL", but most people in the know (so to speak) tend to write just "Postgres" and IMO it reads more fluently, though of course this is subjective. Here, go through all our public-facing docs and descriptions and convert uses of "PostgreSQL" to "Postgres". --- .github/workflows/ci.yaml | 14 +++--- .github/workflows/java.yaml | 4 +- .github/workflows/js.yaml | 4 +- .github/workflows/ruby.yaml | 6 +-- .github/workflows/rust.yaml | 4 +- AGENTS.md | 1 + CHANGELOG.md | 12 ++--- Makefile | 30 ++++++------ docs/development.md | 4 +- docs/yugabyte.md | 2 +- java/DIFFERENCES.md | 2 +- java/README.md | 24 +++++----- java/VALIDATION.md | 46 +++++++++---------- java/bin/sync-migrations/main.go | 2 +- .../java/com/riverqueue/cli/MigrationCli.java | 6 +-- java/conformance/feature-inventory.json | 20 ++++---- .../src/main/java/com/riverqueue/Workers.java | 2 +- .../java/com/riverqueue/package-info.java | 4 +- ...tbox_sqlite_jsonb_and_sql_cleanup.down.sql | 2 +- ...outbox_sqlite_jsonb_and_sql_cleanup.up.sql | 2 +- .../008_job_id_autoincrement.down.sql | 2 +- .../postgres/008_job_id_autoincrement.up.sql | 2 +- .../sqlite/008_job_id_autoincrement.up.sql | 2 +- .../java/com/riverqueue/TestDatabase.java | 6 +-- js/CHANGELOG.md | 2 +- js/README.md | 12 ++--- js/cli/README.md | 10 ++-- js/cli/src/bench.ts | 11 ++--- js/cli/src/database.ts | 14 +++--- js/cli/src/migrate-commands.ts | 8 ++-- js/cli/src/run.integration.test.ts | 2 +- js/cli/src/run.test.ts | 8 ++-- js/cli/src/run.ts | 4 +- js/docs/README.md | 12 ++--- js/docs/databases.md | 12 ++--- js/docs/deployment.md | 2 +- js/docs/development.md | 10 ++-- js/docs/migrating-from-0.1.md | 6 +-- js/docs/testing.md | 4 +- js/driver/pg/README.md | 6 +-- js/driver/pg/etc/driver-pg.api.md | 4 +- js/driver/pg/src/database.ts | 14 +++--- js/driver/pg/src/driver.integration.test.ts | 12 ++--- js/driver/pg/src/driver.test.ts | 16 +++---- js/driver/pg/src/driver.ts | 14 +++--- js/driver/pg/src/errors.ts | 8 ++-- js/driver/pg/src/exact-types.ts | 30 +++++------- js/driver/pg/src/pilot.integration.test.ts | 8 ++-- js/driver/pg/src/pilot.ts | 2 +- js/driver/pg/src/runtime.integration.test.ts | 6 +-- js/driver/pg/src/sql/jobs.ts | 6 +-- js/driver/pg/src/sql/maintenance.ts | 8 ++-- js/driver/pg/src/sql/notify.ts | 16 +++---- js/driver/pg/src/sql/params.ts | 2 +- js/driver/pg/src/sql/queues.ts | 2 +- js/driver/pg/src/sql/rows.ts | 2 +- js/driver/pg/src/stress.integration.test.ts | 2 +- js/driver/pg/src/types.ts | 8 ++-- js/driver/pg/src/yugabyte.integration.test.ts | 10 ++-- js/driver/prisma/README.md | 2 +- js/driver/prisma/etc/driver-prisma.api.md | 6 +-- js/driver/prisma/src/driver.test.ts | 2 +- js/driver/prisma/src/driver.ts | 14 +++--- .../prisma/src/prisma.integration.test.ts | 2 +- js/driver/sqlite/src/codecs.ts | 4 +- js/driver/sqlite/src/coordination.test.ts | 2 +- js/driver/sqlite/src/pilot.test.ts | 2 +- js/etc/riverqueue.api.md | 8 ++-- js/etc/riverqueue.unstable-driver.api.md | 26 +++++------ js/examples/mixed-language/README.md | 2 +- js/examples/node-postgres/README.md | 6 +-- js/examples/pg-worker/README.md | 6 +-- js/examples/prisma/README.md | 4 +- js/migrate/README.md | 6 +-- js/migrate/etc/migrate.api.md | 14 +++--- js/migrate/migrations/manifest.json | 10 ++-- ...tbox_sqlite_jsonb_and_sql_cleanup.down.sql | 2 +- ...outbox_sqlite_jsonb_and_sql_cleanup.up.sql | 2 +- .../main/008_job_id_autoincrement.down.sql | 2 +- .../main/008_job_id_autoincrement.up.sql | 2 +- .../main/008_job_id_autoincrement.up.sql | 2 +- js/migrate/src/bundle.ts | 2 +- js/migrate/src/index.ts | 2 +- js/migrate/src/migrator.integration.test.ts | 2 +- js/migrate/src/migrator.test.ts | 6 +-- js/migrate/src/migrator.ts | 6 +-- js/migrate/src/postgres.ts | 18 ++++---- js/migrate/src/sqlite.ts | 4 +- js/migrate/src/storage.ts | 2 +- js/scripts/check-packages.mjs | 2 +- js/scripts/packed-tests/postgres.test.mjs | 2 +- js/scripts/sync-migrations.mjs | 2 +- js/src/client.ts | 2 +- js/src/driver.ts | 6 +-- js/src/internal/maintenance-batch.ts | 2 +- js/src/internal/postgres-capabilities.ts | 14 +++--- js/src/internal/sql.ts | 2 +- js/src/internal/timestamp.ts | 6 +-- js/src/options.ts | 6 +-- js/src/pilot.ts | 6 +-- js/src/runtime.ts | 2 +- js/src/runtime/failures.ts | 2 +- js/src/services.test.ts | 2 +- js/src/services.ts | 2 +- js/vitest.integration.config.ts | 2 +- riverdriver/postgres_capabilities.go | 2 +- riverdriver/river_driver_interface.go | 4 +- ...tbox_sqlite_jsonb_and_sql_cleanup.down.sql | 2 +- ...outbox_sqlite_jsonb_and_sql_cleanup.up.sql | 2 +- .../main/008_job_id_autoincrement.down.sql | 2 +- .../main/008_job_id_autoincrement.up.sql | 2 +- .../yugabyte_compatibility_test.go | 4 +- riverdriver/riverdrivertest/benchmark.go | 2 +- .../riverdrivertest/client_job_update_test.go | 2 +- .../riverdrivertest/driver_client_test.go | 2 +- riverdriver/riverdrivertest/executor_tx.go | 4 +- ...tbox_sqlite_jsonb_and_sql_cleanup.down.sql | 2 +- ...outbox_sqlite_jsonb_and_sql_cleanup.up.sql | 2 +- .../main/008_job_id_autoincrement.down.sql | 2 +- .../main/008_job_id_autoincrement.up.sql | 2 +- .../riverpgxv5/yugabyte_compatibility_test.go | 4 +- .../main/008_job_id_autoincrement.up.sql | 2 +- .../riversqlite/river_sqlite_driver.go | 6 +-- riverdriver/unique_insert.go | 8 ++-- riverdriver/unique_insert_test.go | 6 +-- rivershared/riversharedtest/yugabyte.go | 4 +- ruby/CHANGELOG.md | 10 ++-- ruby/Makefile | 2 +- ruby/README.md | 4 +- ruby/docs/README.md | 8 ++-- ruby/docs/conformance.md | 10 ++-- ruby/docs/development.md | 18 ++++---- ruby/docs/migrating_from_sidekiq.md | 6 +-- ruby/docs/migrations.md | 12 ++--- ruby/docs/testing.md | 2 +- ruby/docs/yugabyte.md | 16 +++---- .../riverqueue-activerecord/docs/README.md | 6 +-- .../docs/development.md | 2 +- .../riverqueue-activerecord/lib/driver.rb | 4 +- .../riverqueue-activerecord.gemspec | 4 +- .../spec/client_spec.rb | 16 +++---- .../spec/driver_spec.rb | 6 +-- .../spec/migrator_spec.rb | 2 +- .../spec/spec_helper.rb | 2 +- .../spec/yugabyte_spec.rb | 8 ++-- ruby/driver/riverqueue-sequel/docs/README.md | 6 +-- .../riverqueue-sequel/docs/development.md | 2 +- ruby/driver/riverqueue-sequel/lib/driver.rb | 4 +- .../riverqueue-sequel.gemspec | 4 +- .../riverqueue-sequel/spec/client_spec.rb | 16 +++---- .../riverqueue-sequel/spec/driver_spec.rb | 4 +- .../riverqueue-sequel/spec/migrator_spec.rb | 2 +- .../riverqueue-sequel/spec/spec_helper.rb | 4 +- .../riverqueue-sequel/spec/yugabyte_spec.rb | 8 ++-- ruby/lib/driver/job_row_decoder.rb | 4 +- ruby/lib/driver/postgres_capabilities.rb | 2 +- ruby/lib/driver/runtime.rb | 8 ++-- ruby/lib/job_persisted_logging/plugin.rb | 2 +- ruby/lib/migrator.rb | 2 +- ruby/migration/manifest.json | 10 ++-- ...tbox_sqlite_jsonb_and_sql_cleanup.down.sql | 2 +- ...outbox_sqlite_jsonb_and_sql_cleanup.up.sql | 2 +- .../main/008_job_id_autoincrement.down.sql | 2 +- .../main/008_job_id_autoincrement.up.sql | 2 +- .../main/008_job_id_autoincrement.up.sql | 2 +- ruby/rails/riverqueue-rails/README.md | 6 +-- .../riverqueue-rails/spec/integration_spec.rb | 2 +- ruby/riverqueue.gemspec | 2 +- ruby/spec/client_driver_shared_examples.rb | 6 +-- ruby/spec/conformance_spec.rb | 4 +- ruby/spec/driver_runtime_feature_spec.rb | 10 ++-- ruby/spec/driver_runtime_shared_examples.rb | 2 +- .../insert_notification_shared_examples.rb | 18 ++++---- ruby/spec/migrator_spec.rb | 2 +- ruby/spec/support/client_test_database.rb | 2 +- ruby/spec/support/river_test_schema.rb | 2 +- ruby/spec/support/yugabyte_test_database.rb | 2 +- ruby/spec/test_schema_spec.rb | 2 +- rust/CHANGELOG.md | 2 +- rust/Cargo.toml | 2 +- rust/README.md | 8 ++-- rust/riverqueue-cli/src/bench.rs | 2 +- rust/riverqueue-cli/src/main.rs | 2 +- rust/riverqueue-cli/src/migrate.rs | 4 +- rust/riverqueue-migrate/Cargo.toml | 2 +- rust/riverqueue-migrate/README.md | 4 +- ...tbox_sqlite_jsonb_and_sql_cleanup.down.sql | 2 +- ...outbox_sqlite_jsonb_and_sql_cleanup.up.sql | 2 +- .../main/008_job_id_autoincrement.down.sql | 2 +- .../main/008_job_id_autoincrement.up.sql | 2 +- .../main/008_job_id_autoincrement.up.sql | 2 +- rust/riverqueue-migrate/src/lib.rs | 8 ++-- rust/riverqueue-migrate/src/schema.rs | 18 ++++---- rust/riverqueue/README.md | 10 ++-- rust/riverqueue/examples/custom_schema.rs | 4 +- rust/riverqueue/examples/transactions.rs | 2 +- rust/riverqueue/src/__private.rs | 20 ++++---- rust/riverqueue/src/client/builder.rs | 2 +- rust/riverqueue/src/client/completer.rs | 6 +-- rust/riverqueue/src/client/insert.rs | 2 +- rust/riverqueue/src/client/jobs.rs | 2 +- rust/riverqueue/src/client/mod.rs | 8 ++-- rust/riverqueue/src/client/notifier.rs | 7 +-- rust/riverqueue/src/client/producer.rs | 12 ++--- rust/riverqueue/src/client/record.rs | 2 +- rust/riverqueue/src/client/resign.rs | 2 +- rust/riverqueue/src/client/run.rs | 2 +- rust/riverqueue/src/client/tests.rs | 2 +- rust/riverqueue/src/client/validate.rs | 2 +- rust/riverqueue/src/database.rs | 30 ++++++------ rust/riverqueue/src/database/erased.rs | 10 ++-- .../src/database/postgres_capabilities.rs | 10 ++-- rust/riverqueue/src/database/sqlite.rs | 8 ++-- rust/riverqueue/src/job/metadata.rs | 2 +- rust/riverqueue/src/maintenance/cleaner.rs | 2 +- rust/riverqueue/src/maintenance/mod.rs | 6 +-- rust/riverqueue/src/maintenance/postgres.rs | 4 +- rust/riverqueue/src/maintenance/tests.rs | 4 +- rust/riverqueue/src/pilot.rs | 2 +- rust/riverqueue/src/query.rs | 4 +- rust/riverqueue/src/storage/postgres.rs | 6 +-- rust/riverqueue/tests/caller_transactions.rs | 6 +-- rust/riverqueue/tests/client_handles.rs | 6 +-- rust/riverqueue/tests/database_contract.rs | 4 +- rust/riverqueue/tests/extension_seams.rs | 2 +- rust/riverqueue/tests/extension_services.rs | 2 +- .../tests/fetch_only_known_kinds.rs | 2 +- rust/riverqueue/tests/insert_notifications.rs | 2 +- rust/riverqueue/tests/job_list.rs | 4 +- .../tests/leader_election_disabled.rs | 2 +- rust/riverqueue/tests/metadata_exact.rs | 4 +- rust/riverqueue/tests/peer_attempts.rs | 2 +- .../tests/poll_only_cancellation.rs | 2 +- rust/riverqueue/tests/postgres.rs | 4 +- rust/riverqueue/tests/postgres_parity.rs | 2 +- rust/riverqueue/tests/prepared_insertion.rs | 2 +- rust/riverqueue/tests/producer_lifetime.rs | 2 +- rust/riverqueue/tests/producer_sessions.rs | 2 +- rust/riverqueue/tests/resilience_postgres.rs | 10 ++-- rust/riverqueue/tests/support/mod.rs | 6 +-- rust/riverqueue/tests/yugabyte.rs | 8 ++-- 241 files changed, 687 insertions(+), 698 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 499b13c35..d5dac685e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -147,7 +147,7 @@ jobs: strategy: matrix: # Keep both supported Go versions covered without repeating SQLite, - # libSQL, and Turso tests for every PostgreSQL version. + # libSQL, and Turso tests for every Postgres version. go-version: ["1.27", "1.26"] include: # Only the newest Go version runs with the race detector. @@ -181,18 +181,18 @@ jobs: timeout-minutes: 10 steps: - # CLI tests use each runner's bundled PostgreSQL version; the database - # test matrix above covers supported PostgreSQL versions separately. - # GitHub's Linux image includes PostgreSQL with its service disabled. - - name: Set up PostgreSQL (Linux) + # CLI tests use each runner's bundled Postgres version; the database + # test matrix above covers supported Postgres versions separately. + # GitHub's Linux image includes Postgres with its service disabled. + - name: Set up Postgres (Linux) if: runner.os == 'Linux' run: | sudo systemctl start postgresql.service sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres'" sudo -u postgres createdb river_dev - # GitHub's Windows image exposes its PostgreSQL binaries via PGBIN. - - name: Set up PostgreSQL (Windows) + # GitHub's Windows image exposes its Postgres binaries via PGBIN. + - name: Set up Postgres (Windows) if: runner.os == 'Windows' shell: pwsh env: diff --git a/.github/workflows/java.yaml b/.github/workflows/java.yaml index ff482e0ca..b93064388 100644 --- a/.github/workflows/java.yaml +++ b/.github/workflows/java.yaml @@ -93,7 +93,7 @@ jobs: run: make test/java/sqlite postgres: - name: Test (PostgreSQL ${{ matrix.postgres-version }}) + name: Test (Postgres ${{ matrix.postgres-version }}) runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -128,5 +128,5 @@ jobs: with: go-version-file: go.work - - name: PostgreSQL client, worker, and migration tests + - name: Postgres client, worker, and migration tests run: make test/java/postgres diff --git a/.github/workflows/js.yaml b/.github/workflows/js.yaml index 634a146fe..af5306e28 100644 --- a/.github/workflows/js.yaml +++ b/.github/workflows/js.yaml @@ -94,7 +94,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 - # The packed `node:test` suite runs its PostgreSQL tests against this + # The packed `node:test` suite runs its Postgres tests against this # database, and RIVER_REQUIRE_POSTGRES makes them fail instead of skip # when DATABASE_URL is missing. services: @@ -200,7 +200,7 @@ jobs: - run: pnpm run test test_integration: - name: Test (integration, PostgreSQL ${{ matrix.postgres-version }}) + name: Test (integration, Postgres ${{ matrix.postgres-version }}) runs-on: ubuntu-latest timeout-minutes: 20 diff --git a/.github/workflows/ruby.yaml b/.github/workflows/ruby.yaml index a6af446c7..794389382 100644 --- a/.github/workflows/ruby.yaml +++ b/.github/workflows/ruby.yaml @@ -61,7 +61,7 @@ jobs: fail-fast: false matrix: include: - # Latest Ruby against all supported PostgreSQL versions. + # Latest Ruby against all supported Postgres versions. - ruby: "4.0" postgres: 18 primary: true @@ -74,7 +74,7 @@ jobs: - ruby: "4.0" postgres: 14 - # Older Ruby versions against the latest PostgreSQL only. + # Older Ruby versions against the latest Postgres only. - ruby: "3.4" postgres: 18 - ruby: "3.3" @@ -192,7 +192,7 @@ jobs: with: ruby-version: "4.0" working-directory: ruby/rails/riverqueue-rails - # Reuse the runner, PostgreSQL service, and installed gems across versions. + # Reuse the runner, Postgres service, and installed gems across versions. - name: Test Rails 7.2 env: RAILS_VERSION: "~> 7.2.0" diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index 4223e0002..1d78ad5c0 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -61,7 +61,7 @@ jobs: with: tool: cargo-semver-checks@0.51.0 - - name: Lint, including PostgreSQL-only and SQLite-only builds + - name: Lint, including Postgres-only and SQLite-only builds run: make lint/rust - name: Documentation and examples @@ -162,5 +162,5 @@ jobs: go-version-file: go.work - name: Create test database run: PGPASSWORD=postgres createdb -h localhost -U postgres river_rust_test - - name: Rust unit, SQLite, and PostgreSQL tests + - name: Rust unit, SQLite, and Postgres tests run: make test/rust diff --git a/AGENTS.md b/AGENTS.md index 4712c5757..9c8abaac5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,6 +28,7 @@ - **Testing**: use require variants instead of assert. - **Helpers**: use `Func` suffix for function variables, not `Fn`. - **Documentation**: include comments for exported functions and types. +- **Terminology**: prefer "Postgres" over "PostgreSQL". - **Naming**: use idiomatic Go names; see `.golangci.yaml` for allowed short variable names. ## Package Naming and Organization diff --git a/CHANGELOG.md b/CHANGELOG.md index c7dc90d86..50d89362e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,15 +45,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed cancelled transaction starts leaving Turso connections unusable, which could prevent maintenance from recovering after a startup failure. [PR #1347](https://github.com/riverqueue/river/pull/1347). - Fixed maintenance startup failures leaving a client renewing leadership with maintenance stopped in poll-only mode. After exhausting startup retries, clients now request local resignation without depending on database notifications. [PR #1347](https://github.com/riverqueue/river/pull/1347). -- Fixed `JobRescuer` overwriting jobs that complete, leave the running state, or are claimed again by another worker after being fetched for rescue, preserving their state, errors, metadata, and timestamps across PostgreSQL and SQLite drivers. Fixes [#1302](https://github.com/riverqueue/river/issues/1302). [PR #1373](https://github.com/riverqueue/river/pull/1373). +- Fixed `JobRescuer` overwriting jobs that complete, leave the running state, or are claimed again by another worker after being fetched for rescue, preserving their state, errors, metadata, and timestamps across Postgres and SQLite drivers. Fixes [#1302](https://github.com/riverqueue/river/issues/1302). [PR #1373](https://github.com/riverqueue/river/pull/1373). - Fixed SQLite job list pagination skipping or repeating jobs by formatting cursor timestamps consistently with stored timestamps. [PR #1374](https://github.com/riverqueue/river/pull/1374). -- Improved PostgreSQL job listing performance when filtering by one finalized state (`completed`, `cancelled`, or `discarded`) and sorting by finalized time, including in River UI. [PR #1374](https://github.com/riverqueue/river/pull/1374). +- Improved Postgres job listing performance when filtering by one finalized state (`completed`, `cancelled`, or `discarded`) and sorting by finalized time, including in River UI. [PR #1374](https://github.com/riverqueue/river/pull/1374). - Fixed `rivermigrate` leaving `river_migration` rows behind after migrating a non-main migration line down through its version 1, which caused a later up migration of that line to skip version 1. With `MigrateTx`, rows for every removed version were left behind. [PR #1378](https://github.com/riverqueue/river/pull/1378). - Fixed `river bench` inserting every benchmark job with a `num` arg of `0` instead of numbering jobs sequentially. [PR #1379](https://github.com/riverqueue/river/pull/1379). - Attempt errors that are valid JSON but don't have the shape River writes (for example an `at` timestamp in another format, an `attempt` stored as a string, or an `error` or `trace` that isn't a string) are now decoded on a best effort basis when reading jobs from the database. Timestamps outside RFC 3339 are left zero; stored values are unchanged. Previously a single such element made its job unreadable, and if that happened while fetching jobs, every job locked in the same fetch was left `running` indefinitely. [PR #1380](https://github.com/riverqueue/river/pull/1380). - A fetched job whose row can't be decoded (for example a SQLite job whose `tags` were changed to something other than an array of strings) no longer leaves every job locked in the same fetch stuck `running`. The other jobs are worked normally, while the undecodable job's attempt fails with an error describing the decode failure, and it's retried or discarded like any other failed job. Its original values are preserved, with non-array `errors` values wrapped to append the failure or rescue error. Neither the rescuer nor the SQLite scheduler fails on such a job, so its retry doesn't stop other jobs from being rescued or scheduled. [PR #1380](https://github.com/riverqueue/river/pull/1380). - Fixed SQLite notification listeners delivering notifications from before a subscription or from an unsubscribe gap. Notification reads now fetch subscribed topics in bounded batches, and cleanup deletes expired notifications in batches of 10,000 rows (reduced to 1,000 after repeated timeouts), with pauses between batches to reduce write lock contention. [PR #1381](https://github.com/riverqueue/river/pull/1381). -- Fixed the job completer panicking when a job it was finalizing had its state changed concurrently, like being moved to `pending` out of band, or being rescued while the completer's update waited on the row lock (in which case PostgreSQL returns the job's pre-update `running` row). Such jobs are now skipped without emitting a completion event. [PR #1383](https://github.com/riverqueue/river/pull/1383). +- Fixed the job completer panicking when a job it was finalizing had its state changed concurrently, like being moved to `pending` out of band, or being rescued while the completer's update waited on the row lock (in which case Postgres returns the job's pre-update `running` row). Such jobs are now skipped without emitting a completion event. [PR #1383](https://github.com/riverqueue/river/pull/1383). - Fixed `JobList` pagination skipping or repeating jobs when ordering by `JobListOrderByTime` with multiple states. Cursors now use the same time field as the list's ordering (the one for the first listed state) rather than the one for each job's own state. Jobs where that field is null, like `finalized_at` for unfinalized jobs, are paginated correctly and consistently sort last in ascending order and first in descending order on all drivers. Ordering by `JobListOrderByTime` with an empty `States()` filter now uses `scheduled_at` instead of returning an error. [PR #1384](https://github.com/riverqueue/river/pull/1384). - A SQLite job whose `args`, `attempted_by`, `errors`, `metadata`, or `tags` were changed to text that isn't valid JSON no longer makes every fetch from its queue fail with a "malformed JSON" error. The job's attempt fails like that of any other job that can't be decoded, and completing, rescuing, or scheduling it no longer fails either. Invalid values are left in place, except that an invalid `errors` value is kept as a string in a new array so that attempt errors can still be appended. [PR #1386](https://github.com/riverqueue/river/pull/1386). - Fixed `UniqueOpts.ByArgs` skipping distinct jobs or failing inserts when JSON keys contain path syntax (like `user.id`), are empty, or come from unnamed tags like `json:",omitempty"`. Unaffected unique keys remain unchanged; affected jobs may be inserted again after upgrading or by old and new clients during a rolling upgrade. [PR #1387](https://github.com/riverqueue/river/pull/1387). @@ -63,7 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed the `Job appears to be stuck` log line reporting the client-level `JobTimeout` instead of the worker-level timeout when a worker overrides `Timeout`. [PR #1394](https://github.com/riverqueue/river/pull/1394). - Fixed job cancellations received during a fetch being lost before the fetched jobs started. Matching jobs now receive cancellation before work begins. [PR #1397](https://github.com/riverqueue/river/pull/1397). - Fixed SQLite `JobCancel` and `JobCancelTx` notifying running workers through the shared control outbox, so their contexts are cancelled when the transaction commits. [PR #1398](https://github.com/riverqueue/river/pull/1398). -- Fixed SQLite `InsertMany` and `InsertManyTx` reporting multiple inserted jobs when a batch contains the same active unique key more than once. Such batches now fail atomically, matching PostgreSQL. [PR #1399](https://github.com/riverqueue/river/pull/1399). +- Fixed SQLite `InsertMany` and `InsertManyTx` reporting multiple inserted jobs when a batch contains the same active unique key more than once. Such batches now fail atomically, matching Postgres. [PR #1399](https://github.com/riverqueue/river/pull/1399). - Fixed error and panic handlers receiving the wrong job row when a single execution reports errors for multiple jobs. [PR #1401](https://github.com/riverqueue/river/pull/1401). - Fixed the default retry policy scheduling a job's retry about 292 years in the past on amd64 once the job had errored 310 or more times, which made it run again immediately. The capped retry delay is now exactly the maximum duration on every architecture. [PR #1402](https://github.com/riverqueue/river/pull/1402). - Fixed up migrations targeting an already-applied version to do nothing instead of applying later pending migrations. [PR #1403](https://github.com/riverqueue/river/pull/1403). @@ -99,7 +99,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - SQLite job completion, rescue, and full-update paths now serialize timestamps using River's standard millisecond format instead of relying on database driver serialization, preventing inconsistent timestamp representations from being persisted. [PR #1353](https://github.com/riverqueue/river/pull/1353) -- SQLite drivers now return a non-nil empty `JobRow.Errors` slice for jobs without errors, matching the behavior of PostgreSQL drivers and ensuring the field serializes to `[]` instead of `null`. [PR #1354](https://github.com/riverqueue/river/pull/1354). +- SQLite drivers now return a non-nil empty `JobRow.Errors` slice for jobs without errors, matching the behavior of Postgres drivers and ensuring the field serializes to `[]` instead of `null`. [PR #1354](https://github.com/riverqueue/river/pull/1354). ## [0.44.0] - 2026-08-18 @@ -202,7 +202,7 @@ river migrate-get --database-url sqlite:// --version 7 --down > river7.down.sql - Fix `JobCancel` having no effect on running jobs when using a poll-only driver (e.g. `riverdatabasesql`). The `controlActionCancel` event was silently dropped in `fetchAndRunLoop`'s `queueControlCh` handler instead of being forwarded to `maybeCancelJob`. Note: this fix only works within a single process; cross-process cancels in poll-only setups must wait for the next poll cycle. [PR #1245](https://github.com/riverqueue/river/pull/1245). - Ensure jobs that return a custom timeout of -1 (no timeout) are never rescued. [PR #1288](https://github.com/riverqueue/river/pull/1288). -- Detect numbered PostgreSQL `REINDEX INDEX CONCURRENTLY` artifacts like `_ccnew1` and `_ccold2` so the reindexer does not keep accumulating failed artifact indexes. Fixes [#1296](https://github.com/riverqueue/river/issues/1296). [PR #1297](https://github.com/riverqueue/river/pull/1297). +- Detect numbered Postgres `REINDEX INDEX CONCURRENTLY` artifacts like `_ccnew1` and `_ccold2` so the reindexer does not keep accumulating failed artifact indexes. Fixes [#1296](https://github.com/riverqueue/river/issues/1296). [PR #1297](https://github.com/riverqueue/river/pull/1297). ## [0.39.0] - 2026-06-03 diff --git a/Makefile b/Makefile index e9f131d41..a3c116d43 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ RUST_SEMVER_BASELINE_REV ?= $(shell git tag --list 'rust/v*' --sort=-v:refname | TEST_DATABASE ?= all # Only filter the shared driver suite. Other packages have SQLite-named tests -# that use PostgreSQL or mocks and should stay in the regular test run. +# that use Postgres or mocks and should stay in the regular test run. sqlite_test_pattern := ^(Test.*(LibSQL|SQLite|Turso)|Example_(libSQL|sqlite|turso)) test_submodules := $(submodules) legacy_driver_test_flags := -run '/WithTx$$' @@ -159,7 +159,7 @@ ifneq ($(TEST_DATABASE),sqlite) test:: ; cd ./riverdriver/riverdrivertest && RIVER_USE_LEGACY_SUBTRANSACTIONS=1 go test . -run '^TestDriverRiverPgxV5$$/.*/WithTx$$' -timeout 2m endif -# `--cfg river_postgres_tests` builds the Rust PostgreSQL integration tests. +# `--cfg river_postgres_tests` builds the Rust Postgres integration tests. # It goes to both rustc and rustdoc so any doctest gated on it runs too, and # into its own target directory so switching it on and off doesn't rebuild # the ordinary build's artifacts. The default is absolute: trybuild resolves a @@ -174,20 +174,20 @@ test/java: generate/fixtures verify/java-migrations test/java: test/java/tools $(MVN) --batch-mode --no-transfer-progress -f java/pom.xml verify -# Fixture comparisons use temporary SQLite databases, with no PostgreSQL or legacy adapter. +# Fixture comparisons use temporary SQLite databases, with no Postgres or legacy adapter. .PHONY: test/java/conformance test/java/conformance: ## Run Java tests that check Go-generated conformance fixtures test/java/conformance: generate/fixtures $(MVN) --batch-mode --no-transfer-progress -f java/pom.xml -pl river test -Dgroups=conformance -Driver.test.database=sqlite .PHONY: test/java/postgres -test/java/postgres: ## Run Java tests with PostgreSQL client and worker coverage (requires RIVER_TEST_DATABASE_URL) +test/java/postgres: ## Run Java tests with Postgres client and worker coverage (requires RIVER_TEST_DATABASE_URL) test/java/postgres: generate/fixtures verify/java-migrations @test -n "$$RIVER_TEST_DATABASE_URL" || { echo "RIVER_TEST_DATABASE_URL is required" >&2; exit 1; } $(MVN) --batch-mode --no-transfer-progress -f java/pom.xml verify -Driver.test.database=postgres .PHONY: test/java/sqlite -test/java/sqlite: ## Run Java unit, SQLite, and executable CLI tests without PostgreSQL +test/java/sqlite: ## Run Java unit, SQLite, and executable CLI tests without Postgres test/java/sqlite: generate/fixtures verify/java-migrations $(MVN) --batch-mode --no-transfer-progress -f java/pom.xml verify -Driver.test.database=sqlite -DexcludedGroups=postgres @@ -196,9 +196,9 @@ test/java/tools: ## Test Java's Go maintenance tools go test ./java/bin/check-packages/*.go go test ./java/bin/sync-migrations/*.go -# PostgreSQL integration tests need RIVER_RUST_DATABASE_URL. Without it +# Postgres integration tests need RIVER_RUST_DATABASE_URL. Without it # test/rust still runs unit, doc, and SQLite integration tests, and fails in CI -# so a missing URL cannot turn the PostgreSQL suite into a silent pass. +# so a missing URL cannot turn the Postgres suite into a silent pass. .PHONY: test/js test/js: ## Run JavaScript unit tests test/js: build/js @@ -217,19 +217,19 @@ test/js/conformance: generate/fixtures # postgres://localhost:5432/river_test), migrated with # `node js/cli/dist/bin.js migrate-up`. .PHONY: test/js/integration -test/js/integration: ## Run JavaScript integration tests against PostgreSQL +test/js/integration: ## Run JavaScript integration tests against Postgres test/js/integration: build/js pnpm -C js run test:integration .PHONY: test/rust -test/rust: ## Run Rust unit and SQLite tests, plus PostgreSQL tests when RIVER_RUST_DATABASE_URL is set +test/rust: ## Run Rust unit and SQLite tests, plus Postgres tests when RIVER_RUST_DATABASE_URL is set test/rust: generate/fixtures @if [ -n "$$RIVER_RUST_DATABASE_URL" ]; then \ cd rust && $(RUST_POSTGRES_TESTS_ENV) cargo test --workspace --all-features --locked; \ elif [ -n "$$CI" ]; then \ - echo "RIVER_RUST_DATABASE_URL is required in CI to run the Rust PostgreSQL tests" >&2; exit 1; \ + echo "RIVER_RUST_DATABASE_URL is required in CI to run the Rust Postgres tests" >&2; exit 1; \ else \ - echo "RIVER_RUST_DATABASE_URL is unset; skipping Rust PostgreSQL integration tests"; \ + echo "RIVER_RUST_DATABASE_URL is unset; skipping Rust Postgres integration tests"; \ cd rust && cargo test --workspace --features riverqueue/sqlite,riverqueue-migrate/sqlite --locked; \ fi @@ -241,13 +241,13 @@ test/rust/conformance: generate/fixtures cd rust && cargo test -p riverqueue --features chrono-tz --lib --test protocol_fixtures --locked .PHONY: test/rust/postgres -test/rust/postgres: ## Run all Rust tests, including PostgreSQL integration tests (requires RIVER_RUST_DATABASE_URL) +test/rust/postgres: ## Run all Rust tests, including Postgres integration tests (requires RIVER_RUST_DATABASE_URL) test/rust/postgres: generate/fixtures @test -n "$$RIVER_RUST_DATABASE_URL" || { echo "RIVER_RUST_DATABASE_URL is required" >&2; exit 1; } cd rust && $(RUST_POSTGRES_TESTS_ENV) cargo test --workspace --all-features --locked .PHONY: test/rust/sqlite -test/rust/sqlite: ## Run Rust unit, doc, and SQLite integration tests without a PostgreSQL database +test/rust/sqlite: ## Run Rust unit, doc, and SQLite integration tests without a Postgres database test/rust/sqlite: generate/fixtures cd rust && cargo test --workspace --features riverqueue/sqlite,riverqueue-migrate/sqlite --locked @@ -281,7 +281,7 @@ check/js/dependencies: ## Audit JavaScript advisories and production dependency pnpm -C js run license:check # Packs every published package and checks the archives in clean consumers, -# including the 0.1 upgrade fixture. Its PostgreSQL tests run when +# including the 0.1 upgrade fixture. Its Postgres tests run when # DATABASE_URL is set. .PHONY: check/js/package check/js/package: ## Build and verify publishable npm archives without publishing @@ -341,7 +341,7 @@ endef $(foreach mod,$(submodules),$(eval $(call bench-target,$(mod)))) .PHONY: bench/rust -bench/rust: ## Run the destructive Rust PostgreSQL throughput benchmark +bench/rust: ## Run the destructive Rust Postgres throughput benchmark cd rust && cargo run --release --locked -p riverqueue-cli --bin riverqueue -- bench $(if $(DATABASE_URL),--database-url "$(DATABASE_URL)") $(RUST_BENCH_ARGS) .PHONY: tidy diff --git a/docs/development.md b/docs/development.md index cf50d1256..8b0454959 100644 --- a/docs/development.md +++ b/docs/development.md @@ -16,7 +16,7 @@ Run tests: By default, this runs all workspace modules and database drivers. Use `make test/race` to enable the race detector. -To run only the SQLite, libSQL, and Turso driver tests (no PostgreSQL needed): +To run only the SQLite, libSQL, and Turso driver tests (no Postgres needed): make test TEST_DATABASE=sqlite @@ -25,7 +25,7 @@ To run the regular suite with the SQLite driver tests excluded: make test TEST_DATABASE=postgres `TEST_DATABASE` also applies to `make test/race`. CI separates these suites so -the PostgreSQL version matrix doesn't repeat the SQLite tests. Each suite still +the Postgres version matrix doesn't repeat the SQLite tests. Each suite still runs on both supported Go versions. Only the latest combination in each matrix uses the race detector, marked `race` in its job title. diff --git a/docs/yugabyte.md b/docs/yugabyte.md index f00fe0c5f..2f15dcd5b 100644 --- a/docs/yugabyte.md +++ b/docs/yugabyte.md @@ -1,6 +1,6 @@ # YugabyteDB -The PostgreSQL drivers automatically use polling when YugabyteDB's +The Postgres drivers automatically use polling when YugabyteDB's `yb_enable_listen_notify` setting is absent or disabled. This includes YugabyteDB 2025.2.1, even with the default `PollOnly: false`. New jobs are picked up on the `FetchPollInterval`, and queue pause, resume, and metadata changes are picked up diff --git a/java/DIFFERENCES.md b/java/DIFFERENCES.md index fd82ea440..73f056f5a 100644 --- a/java/DIFFERENCES.md +++ b/java/DIFFERENCES.md @@ -40,7 +40,7 @@ - SQL is kept in dialect-specific resource catalogs. The Go sqlc driver seam is not part of the Java API. - SQLite follows Go's JSONB storage and millisecond timestamp representation; - PostgreSQL uses microsecond timestamps. These are shared storage contracts, + Postgres uses microsecond timestamps. These are shared storage contracts, not configurable Java serialization choices. No intentional differences in stored uniqueness hashes, job state values, reserved diff --git a/java/README.md b/java/README.md index e6914eca5..eefaffc21 100644 --- a/java/README.md +++ b/java/README.md @@ -1,6 +1,6 @@ # River for Java -Prerelease Java 21 client and worker runtime for River's PostgreSQL and SQLite +Prerelease Java 21 client and worker runtime for River's Postgres and SQLite schemas. Jobs are ordinary River jobs: another language can insert, cancel, retry, or work them using the same database. @@ -9,7 +9,7 @@ retry, or work them using the same database. Define job arguments as a record, give the job a stable kind, and register a worker lambda. This complete `Example.java` starts a client, inserts a job, waits for its completion, and stops the workers. Set `DATABASE_URL` to a -PostgreSQL URL or a file-backed SQLite JDBC URL. +Postgres URL or a file-backed SQLite JDBC URL. ```java import com.riverqueue.*; @@ -76,7 +76,7 @@ for each operation. River never closes an application-owned data source. An ## Migration CLI -The `river-cli` executable JAR includes PostgreSQL and SQLite JDBC drivers and +The `river-cli` executable JAR includes Postgres and SQLite JDBC drivers and runs with Java 21 or newer. It needs no Go installation or application classpath. Build it as described under [Installation](#installation), then run: @@ -94,7 +94,7 @@ java -jar "$RIVER_CLI" migrate-up The Maven executable artifact is `com.riverqueue:river-cli` with version `0.48.0-alpha.1` and classifier `all`. Copy that single JAR into your deployment image to run migrations before starting workers. `--database-url URL` overrides `DATABASE_URL`. -`--schema background_jobs` selects a PostgreSQL schema; an actual migration up +`--schema background_jobs` selects a Postgres schema; an actual migration up creates it if needed. Listing and dry runs do not create schemas or migration tables. | Command | Behavior | @@ -117,7 +117,7 @@ java -jar "$RIVER_CLI" migrate-get --version 3 --up > river_3.up.sql java -jar "$RIVER_CLI" migrate-get --driver sqlite --all --up > river_sqlite.up.sql ``` -SQL export defaults to PostgreSQL without a database URL. Use `--driver sqlite` +SQL export defaults to Postgres without a database URL. Use `--driver sqlite` for SQLite, or select the dialect through the URL. Export accepts comma-separated `--version` values or `--all`; `--exclude-version 1` excludes migration history setup when exporting for another migration framework. Exit codes are `0` for @@ -605,7 +605,7 @@ with independent connections are not suitable for this runtime. ## Alternate schema -For PostgreSQL, select an [alternate schema](https://riverqueue.com/docs/alternate-schema) +For Postgres, select an [alternate schema](https://riverqueue.com/docs/alternate-schema) on the `Database` used by both migrations and clients. All collaborating clients must target the same schema. The migrator creates it if needed. @@ -656,7 +656,7 @@ ignores interrupts; handlers must cooperate with cancellation. and other River clients through the database. The leader runs periodic insertion and [maintenance](https://riverqueue.com/docs/maintenance-services): scheduling due jobs, rescuing abandoned attempts, cleaning expired jobs and queues, and -reindexing configured PostgreSQL indexes. Leadership is enabled by default. +reindexing configured Postgres indexes. Leadership is enabled by default. `rescueAfter` must not be shorter than `jobTimeout`, so another client does not rescue an attempt that is still allowed to run. Its default is one hour, plus an @@ -698,13 +698,13 @@ make check/modzip ``` `test/java` runs library and executable CLI tests and checks formatting. Client -and worker tests use PostgreSQL when `RIVER_TEST_DATABASE_URL` is set, with a +and worker tests use Postgres when `RIVER_TEST_DATABASE_URL` is set, with a fresh schema for each test that is removed afterward. Otherwise they use SQLite. `test/java/postgres` requires that URL; `test/java/sqlite` explicitly uses SQLite -and excludes PostgreSQL-only tests, even if a URL is set in your environment. +and excludes Postgres-only tests, even if a URL is set in your environment. `test/java/conformance` needs no external database: it runs the JUnit tests tagged `conformance`, using temporary SQLite databases for storage checks even if a -PostgreSQL URL is set. The full SQLite and PostgreSQL targets run these checks +Postgres URL is set. The full SQLite and Postgres targets run these checks against their selected backend. These targets first generate fresh fixtures directly from this checkout's Go implementation, just like `test/js/conformance` and `test/rust/conformance`. @@ -742,7 +742,7 @@ discovery. The Make targets invoke the Go tools by file from the root workspace; the module is not part of `go.work` and must not be tagged as a Go module. The Java CI workflow follows the Rust and JavaScript layout: a quality/package -job, a JDK 21/25 matrix running unit and SQLite tests, and a PostgreSQL 14–18 +job, a JDK 21/25 matrix running unit and SQLite tests, and a Postgres 14–18 matrix running client, worker, and migration tests on JDK 25. All jobs use the shared Java setup action and Maven dependency caching. The whole workflow is filtered to changes in Java, its build configuration, fixtures, and canonical @@ -777,7 +777,7 @@ The full peer matrix uses `multi` with `RIVER_CONFORMANCE_PEER_FILE` set to a colon-separated list of Rust and JS candidate descriptors, and `RIVERQUEUE_JS_ROOT` pointing to the JS checkout. `multi-soak` also requires `RIVER_CONFORMANCE_MULTI_ENGINE_SOAK_DURATION=5m` (or longer). The upstream -harness currently has a PostgreSQL soak; SQLite endurance validation repeats +harness currently has a Postgres soak; SQLite endurance validation repeats `TestMultiEngineSQLiteConformance` with `-count=5`. `python3 bin/import-reference.py --check /path/to/reference` verifies the legacy diff --git a/java/VALIDATION.md b/java/VALIDATION.md index b1eb1bb5e..91a29f18f 100644 --- a/java/VALIDATION.md +++ b/java/VALIDATION.md @@ -1,7 +1,7 @@ # Validation The original port and API review were validated locally on macOS arm64 with -JDK 25, Maven, PostgreSQL 18, and the SQLite JDBC driver pinned in `pom.xml`. +JDK 25, Maven, Postgres 18, and the SQLite JDBC driver pinned in `pom.xml`. The adapters also ran on JDK 27. The build now targets Java 21; the Java 21 compatibility trial is recorded below. Formatting works on JDK 21 and 25. @@ -16,11 +16,11 @@ References: |---|---| | Maven native tests and formatting | Passed, 112 library tests and 7 CLI tests | | Insert-only profile | Passed | -| Full PostgreSQL profile, maintenance, resilience | Passed | +| Full Postgres profile, maintenance, resilience | Passed | | SQLite storage/runtime and resilience | Passed | -| Go + Java + Rust + JS on PostgreSQL and SQLite | Passed | +| Go + Java + Rust + JS on Postgres and SQLite | Passed | | Same-host enqueue, worker, and mixed performance gate | Passed with the original throughput and p95 limits | -| Four-engine PostgreSQL soak | Passed, five minutes | +| Four-engine Postgres soak | Passed, five minutes | | Four-engine SQLite endurance | Passed, five repetitions of the upstream multi-engine suite | The native tests include exact unique-key goldens, cron/maintenance goldens, @@ -45,10 +45,10 @@ failure; no Go source was changed to suppress it. The CLI tests cover environment/argument handling, offline SQL export, dry runs, targets and step limits, and launching the executable JAR without an external classpath. Library tests cover concurrent SQLite initialization, migration -rollback, legacy migration history, and PostgreSQL schema creation and removal. -All were run with PostgreSQL enabled; no tests were skipped. +rollback, legacy migration history, and Postgres schema creation and removal. +All were run with Postgres enabled; no tests were skipped. -After the migration CLI changes, the PostgreSQL mixed conformance suite and both +After the migration CLI changes, the Postgres mixed conformance suite and both SQLite storage/runtime suites passed against the pinned Go reference. The README quick start was compiled and run; its remaining Java examples compiled, and its SQLite testing example ran successfully. @@ -59,9 +59,9 @@ The API review added regression coverage for typed retrieval and mixed-kind batches, checked JDBC hook failure recovery, queue notification atomicity, committed completion followed by a handler exception, and repeated graceful-stop timeouts without implicit cancellation, and job-aware retry policies. All 112 library and 7 CLI tests passed -with PostgreSQL enabled and no skips; Maven's formatting checks passed. +with Postgres enabled and no skips; Maven's formatting checks passed. -The PostgreSQL maintenance, mixed-engine, and resilience suites and the SQLite +The Postgres maintenance, mixed-engine, and resilience suites and the SQLite storage, runtime, and resilience suites were rerun against the pinned Go reference. All README Java blocks compiled; the quickstart and SQLite JUnit example executed successfully. The Rust/JS matrix, performance, and soak entries @@ -71,7 +71,7 @@ above record the earlier port validation and were not repeated for this API pass Validated on macOS arm64 with Temurin 21.0.12.1 and OpenJDK 25.0.1. On both JDKs, the full Maven build and formatting checks passed: 114 library tests and -7 CLI tests, with PostgreSQL enabled and no skips. The library and executable +7 CLI tests, with Postgres enabled and no skips. The library and executable CLI target Java 21 (class file version 65), including when built on JDK 25. The changes replace unnamed `_` variables with named parameters and use @@ -81,7 +81,7 @@ tests launch a JVM with exactly one carrier and use latches to test blocking claims and leadership callbacks. Both failed before the lock change and pass after it. No public API or dependency changes were needed. -With both `JAVA_HOME` and `PATH` selecting JDK 21, the PostgreSQL maintenance, +With both `JAVA_HOME` and `PATH` selecting JDK 21, the Postgres maintenance, mixed-engine, and resilience suites and the SQLite storage, runtime, and resilience suites passed against the pinned Go reference. All README Java blocks compiled on JDK 21; the quickstart and SQLite JUnit example executed. @@ -93,7 +93,7 @@ the earlier results above do not establish their behavior on JDK 21. ## Runtime and option review (2026-10-05) The full Maven build and formatting checks passed on Temurin 21.0.12.1 and -OpenJDK 25.0.1: 126 library tests and 7 CLI tests, with PostgreSQL enabled and +OpenJDK 25.0.1: 126 library tests and 7 CLI tests, with Postgres enabled and no skips. Eleven regression cases reproduced failures before the fixes and passed afterward. They cover throwing observers/subscribers/error handlers, throwing or invalid retry policies, terminal attempts bypassing retry policies, @@ -101,7 +101,7 @@ distinct IDs when reusing a builder, and immutable query metadata. A further test verifies the `uniqueBy(String...)` overload against stored uniqueness keys, including literal dots in field names. -On JDK 21, the PostgreSQL maintenance, mixed-engine, and resilience suites and +On JDK 21, the Postgres maintenance, mixed-engine, and resilience suites and the SQLite storage, runtime, and resilience suites passed against the pinned Go reference. Rust/JS peer, performance, and soak suites were not repeated for this review. No Go code or shared SQL was changed. @@ -116,8 +116,8 @@ copies. The Java branch leaves `js/` and `rust/` identical to this reference. | Check | Result | | --- | --- | | `make test/java/conformance` on JDK 21 | Passed, 142 fixture tests, no database required | -| PostgreSQL 14, 15, 16, 17, and 18 on JDK 25 | Passed, 175 library tests and 7 CLI tests per version, no skips | -| PostgreSQL 18 on JDK 21 | Passed, 175 library tests and 7 CLI tests, no skips | +| Postgres 14, 15, 16, 17, and 18 on JDK 25 | Passed, 175 library tests and 7 CLI tests per version, no skips | +| Postgres 18 on JDK 21 | Passed, 175 library tests and 7 CLI tests, no skips | | SQLite on JDK 21 and 25 | Passed, 174 library tests and 7 CLI tests per JDK, no skips | | `make test/rust/conformance` | Passed, 127 tests, including notification dispatch | | Go `make test` and `make lint` | Passed in the working checkout | @@ -143,11 +143,11 @@ metadata: Go counts `true` as one before incrementing. Cron cases with no next occurrence explicitly assert that the schedule is exhausted. The CI layout separates quality/package checks, a JDK 21/25 SQLite matrix, and a -PostgreSQL 14–18 matrix on JDK 25. Client and worker tests share assertions across -backends. PostgreSQL tests create and remove a schema per case; the version +Postgres 14–18 matrix on JDK 25. Client and worker tests share assertions across +backends. Postgres tests create and remove a schema per case; the version matrix left no test schemas behind. The SQLite runs used an unreachable -PostgreSQL URL to verify that the explicit SQLite target remains independent. -The PostgreSQL target fails without its required database URL. +Postgres URL to verify that the explicit SQLite target remains independent. +The Postgres target fails without its required database URL. Negative checks during the alignment verified missing-fixture diagnostics, missing/changed/extra migration detection, rejection of test/fixture/adapter @@ -168,7 +168,7 @@ duration validation, and rescue configuration. | Check | Result | | --- | --- | | `make test/java/sqlite` on JDK 21 and 25 | Passed, 192 library tests and 7 CLI tests per JDK, no skips | -| `make test/java/postgres` on JDK 21 and 25, local PostgreSQL | Passed, 193 library tests and 7 CLI tests per JDK, no skips | +| `make test/java/postgres` on JDK 21 and 25, local Postgres | Passed, 193 library tests and 7 CLI tests per JDK, no skips | | `make lint/java` and `make check/java/package` on JDK 21 | Passed, including adapter compilation and all five JARs | Tests hold the producer heartbeat or completion transaction behind latches to @@ -206,10 +206,10 @@ isolated copy, this assertion fails against the previous implementation. | Check | Result | | --- | --- | -| `make test/java/conformance` on JDK 21 | Passed, 148 tests, with an unreachable PostgreSQL URL | +| `make test/java/conformance` on JDK 21 | Passed, 148 tests, with an unreachable Postgres URL | | `make test/java/sqlite` on JDK 21 and 25 | Passed, 198 library tests and 7 CLI tests per JDK, no skips | -| `make test/java/postgres` on JDK 21 and 25, local PostgreSQL | Passed, 199 library tests and 7 CLI tests per JDK, no skips | +| `make test/java/postgres` on JDK 21 and 25, local Postgres | Passed, 199 library tests and 7 CLI tests per JDK, no skips | | `make lint/java` and `make check/java/package` on JDK 21 | Passed, including migration verification and all five JARs | -No Go, Rust, JavaScript, or shared fixture source was changed. PostgreSQL's +No Go, Rust, JavaScript, or shared fixture source was changed. Postgres's version matrix and the historical multi-engine and soak suites were not rerun. diff --git a/java/bin/sync-migrations/main.go b/java/bin/sync-migrations/main.go index 391604c8f..6574130e9 100644 --- a/java/bin/sync-migrations/main.go +++ b/java/bin/sync-migrations/main.go @@ -68,7 +68,7 @@ func run(root string, check bool) error { } } if names != nil && !slices.Equal(current, names) { - return errors.New("PostgreSQL and SQLite migration names differ; review the Java catalog") + return errors.New("migration names differ between Postgres and SQLite; review the Java catalog") } names = current } diff --git a/java/cli/src/main/java/com/riverqueue/cli/MigrationCli.java b/java/cli/src/main/java/com/riverqueue/cli/MigrationCli.java index d1aeae458..bdee00485 100644 --- a/java/cli/src/main/java/com/riverqueue/cli/MigrationCli.java +++ b/java/cli/src/main/java/com/riverqueue/cli/MigrationCli.java @@ -45,7 +45,7 @@ private static Database database( && !url.startsWith("jdbc:postgresql:") && !url.startsWith("sqlite:") && !url.startsWith("jdbc:sqlite:")) - throw new Usage("Expected a PostgreSQL URL or a SQLite JDBC URL"); + throw new Usage("Expected a Postgres URL or a SQLite JDBC URL"); Database database; try { database = @@ -101,10 +101,10 @@ private static void help(PrintWriter out, String name, List lines) { out.println(" version Print CLI version"); out.println(); out.println("Connection options:"); - out.println(" --database-url URL PostgreSQL or SQLite JDBC URL; defaults to DATABASE_URL"); + out.println(" --database-url URL Postgres or SQLite JDBC URL; defaults to DATABASE_URL"); out.println( " --driver DRIVER postgres or sqlite; selects dialect for offline SQL export"); - out.println(" --schema NAME PostgreSQL schema (default: connection's current schema)"); + out.println(" --schema NAME Postgres schema (default: connection's current schema)"); out.printf( " --line NAME Migration line: %s (default: main)%n", String.join(", ", lines)); out.println(); diff --git a/java/conformance/feature-inventory.json b/java/conformance/feature-inventory.json index bac637647..fab7a70a8 100644 --- a/java/conformance/feature-inventory.json +++ b/java/conformance/feature-inventory.json @@ -741,7 +741,7 @@ "area": "config", "detail": "bool", "id": "config.PollOnly", - "rationale": "Disables LISTEN in favor of polling. Implementations provide an equivalent notification-free mode, which clients also enter on their own on a PostgreSQL server without LISTEN/NOTIFY, like YugabyteDB by default.", + "rationale": "Disables LISTEN in favor of polling. Implementations provide an equivalent notification-free mode, which clients also enter on their own on a Postgres server without LISTEN/NOTIFY, like YugabyteDB by default.", "scenarios": [ "poll_only_remote_cancellation", "simulated_yugabyte_polling", @@ -1511,7 +1511,7 @@ "area": "driver", "detail": "func(ctx context.Context, key int64) (*struct{}, error)", "id": "driver.Executor.PGAdvisoryXactLock", - "rationale": "Go driver-seam method for PostgreSQL advisory lock helper.", + "rationale": "Go driver-seam method for Postgres advisory lock helper.", "source": "riverdriver/river_driver_interface.go:riverdriver.Executor.PGAdvisoryXactLock", "java_surface": "Database, Sql, Migrator (internal JDBC implementation)" }, @@ -2753,7 +2753,7 @@ "area": "migration", "detail": "create_river_migration up:79def9ab1643 down:34c87dc594bf", "id": "migration.postgres.001", - "rationale": "Main-line PostgreSQL schema version.", + "rationale": "Main-line Postgres schema version.", "scenarios": [ "candidate_migrator_reference_runtime", "historical_migration_down_up", @@ -2767,7 +2767,7 @@ "area": "migration", "detail": "initial_schema up:8915c00d08ed down:8e7e73755b3e", "id": "migration.postgres.002", - "rationale": "Main-line PostgreSQL schema version.", + "rationale": "Main-line Postgres schema version.", "scenarios": [ "candidate_migrator_reference_runtime", "historical_migration_down_up", @@ -2781,7 +2781,7 @@ "area": "migration", "detail": "river_job_tags_non_null up:dedb183bb302 down:bca44f6f0e92", "id": "migration.postgres.003", - "rationale": "Main-line PostgreSQL schema version.", + "rationale": "Main-line Postgres schema version.", "scenarios": [ "candidate_migrator_reference_runtime", "historical_migration_down_up", @@ -2795,7 +2795,7 @@ "area": "migration", "detail": "pending_and_more up:3f7418b0cf78 down:91b5ced7b9d7", "id": "migration.postgres.004", - "rationale": "Main-line PostgreSQL schema version.", + "rationale": "Main-line Postgres schema version.", "scenarios": [ "candidate_migrator_reference_runtime", "historical_migration_down_up", @@ -2809,7 +2809,7 @@ "area": "migration", "detail": "migration_unique_client up:b760f487152c down:de84dca49a5d", "id": "migration.postgres.005", - "rationale": "Main-line PostgreSQL schema version.", + "rationale": "Main-line Postgres schema version.", "scenarios": [ "candidate_migrator_reference_runtime", "historical_migration_down_up", @@ -2823,7 +2823,7 @@ "area": "migration", "detail": "bulk_unique up:3b133f7ce466 down:726483f6e5aa", "id": "migration.postgres.006", - "rationale": "Main-line PostgreSQL schema version.", + "rationale": "Main-line Postgres schema version.", "scenarios": [ "candidate_migrator_reference_runtime", "historical_migration_down_up", @@ -2837,7 +2837,7 @@ "area": "migration", "detail": "notification_outbox_sqlite_jsonb_and_sql_cleanup up:47ec8031b88e down:9131aae23518", "id": "migration.postgres.007", - "rationale": "Main-line PostgreSQL schema version.", + "rationale": "Main-line Postgres schema version.", "scenarios": [ "candidate_migrator_reference_runtime", "historical_migration_down_up", @@ -2851,7 +2851,7 @@ "area": "migration", "detail": "job_id_autoincrement up:0c3750a947d6 down:0c3750a947d6", "id": "migration.postgres.008", - "rationale": "Main-line PostgreSQL schema version.", + "rationale": "Main-line Postgres schema version.", "scenarios": [ "candidate_migrator_reference_runtime", "historical_migration_down_up", diff --git a/java/river/src/main/java/com/riverqueue/Workers.java b/java/river/src/main/java/com/riverqueue/Workers.java index 0a0c1fd32..afb46db51 100644 --- a/java/river/src/main/java/com/riverqueue/Workers.java +++ b/java/river/src/main/java/com/riverqueue/Workers.java @@ -803,7 +803,7 @@ private void listenSqlite() { }); initialized = true; // The initial cursor skips earlier notifications, including inserts since the first - // fetch. Poll again once listening starts, as the PostgreSQL listener does. + // fetch. Poll again once listening starts, as the Postgres listener does. wake.release(); observe("listen_ready"); } diff --git a/java/river/src/main/java/com/riverqueue/package-info.java b/java/river/src/main/java/com/riverqueue/package-info.java index 3e3658b85..f36b30121 100644 --- a/java/river/src/main/java/com/riverqueue/package-info.java +++ b/java/river/src/main/java/com/riverqueue/package-info.java @@ -1,6 +1,6 @@ /** - * Transactional River jobs on PostgreSQL and SQLite. Define a {@link com.riverqueue.JobType}, - * insert through a {@link com.riverqueue.Client}, and register worker lambdas through {@link + * Transactional River jobs on Postgres and SQLite. Define a {@link com.riverqueue.JobType}, insert + * through a {@link com.riverqueue.Client}, and register worker lambdas through {@link * com.riverqueue.Workers.Builder}. Only a running {@code Workers} instance owns resources; close it * or call {@code stop()} when the application stops. * diff --git a/java/river/src/main/resources/com/riverqueue/migration/postgres/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql b/java/river/src/main/resources/com/riverqueue/migration/postgres/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql index bed717f87..9dd01264c 100644 --- a/java/river/src/main/resources/com/riverqueue/migration/postgres/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql +++ b/java/river/src/main/resources/com/riverqueue/migration/postgres/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql @@ -47,7 +47,7 @@ ALTER TABLE /* TEMPLATE: schema */river_queue -- -- SQLite JSONB conversion rollback. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- Notification outbox rollback. diff --git a/java/river/src/main/resources/com/riverqueue/migration/postgres/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql b/java/river/src/main/resources/com/riverqueue/migration/postgres/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql index 39e3249c9..41fabc912 100644 --- a/java/river/src/main/resources/com/riverqueue/migration/postgres/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql +++ b/java/river/src/main/resources/com/riverqueue/migration/postgres/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql @@ -16,7 +16,7 @@ CREATE INDEX river_notification_topic_id_idx ON /* TEMPLATE: schema */river_noti -- -- SQLite JSONB conversion. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- SQL cleanup. diff --git a/java/river/src/main/resources/com/riverqueue/migration/postgres/008_job_id_autoincrement.down.sql b/java/river/src/main/resources/com/riverqueue/migration/postgres/008_job_id_autoincrement.down.sql index 695357bb8..0bad60286 100644 --- a/java/river/src/main/resources/com/riverqueue/migration/postgres/008_job_id_autoincrement.down.sql +++ b/java/river/src/main/resources/com/riverqueue/migration/postgres/008_job_id_autoincrement.down.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/java/river/src/main/resources/com/riverqueue/migration/postgres/008_job_id_autoincrement.up.sql b/java/river/src/main/resources/com/riverqueue/migration/postgres/008_job_id_autoincrement.up.sql index 695357bb8..0bad60286 100644 --- a/java/river/src/main/resources/com/riverqueue/migration/postgres/008_job_id_autoincrement.up.sql +++ b/java/river/src/main/resources/com/riverqueue/migration/postgres/008_job_id_autoincrement.up.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/java/river/src/main/resources/com/riverqueue/migration/sqlite/008_job_id_autoincrement.up.sql b/java/river/src/main/resources/com/riverqueue/migration/sqlite/008_job_id_autoincrement.up.sql index c7de15deb..6ee4b32c7 100644 --- a/java/river/src/main/resources/com/riverqueue/migration/sqlite/008_job_id_autoincrement.up.sql +++ b/java/river/src/main/resources/com/riverqueue/migration/sqlite/008_job_id_autoincrement.up.sql @@ -1,5 +1,5 @@ -- Rebuild river_job so automatically generated IDs are never reused after the --- job holding the largest ID is deleted. Unlike PostgreSQL sequences, SQLite's +-- job holding the largest ID is deleted. Unlike Postgres sequences, SQLite's -- default ROWID allocator may otherwise reuse that deleted ID. -- Rebuilding river_job would discard schema installed by River Pro. Check diff --git a/java/river/src/test/java/com/riverqueue/TestDatabase.java b/java/river/src/test/java/com/riverqueue/TestDatabase.java index b85726ff5..365efd588 100644 --- a/java/river/src/test/java/com/riverqueue/TestDatabase.java +++ b/java/river/src/test/java/com/riverqueue/TestDatabase.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.extension.AfterEachCallback; import org.junit.jupiter.api.extension.ExtensionContext; -/** Isolates each test in a SQLite file or a PostgreSQL schema owned by that test. */ +/** Isolates each test in a SQLite file or a Postgres schema owned by that test. */ final class TestDatabase implements AfterEachCallback { private final List databases = new ArrayList<>(); @@ -27,11 +27,11 @@ Database open(Path file) { if (!backend.equals("postgres")) throw new IllegalArgumentException("Unknown test backend: " + backend); if (url == null || url.isBlank()) - throw new IllegalStateException("RIVER_TEST_DATABASE_URL is required for PostgreSQL tests"); + throw new IllegalStateException("RIVER_TEST_DATABASE_URL is required for Postgres tests"); var database = Database.connect(url).withSchema("java_" + UUID.randomUUID().toString().replace("-", "")); if (database.dialect() != Database.Dialect.POSTGRES) - throw new IllegalArgumentException("RIVER_TEST_DATABASE_URL must select PostgreSQL"); + throw new IllegalArgumentException("RIVER_TEST_DATABASE_URL must select Postgres"); databases.add(database); new Migrator(database).migrate(); return database; diff --git a/js/CHANGELOG.md b/js/CHANGELOG.md index 8f5903652..b747fd449 100644 --- a/js/CHANGELOG.md +++ b/js/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- JavaScript now implements full River client support for PostgreSQL and SQLite, interoperating with Go and Rust in the same database. Includes workers, graceful stopping and cancellation, leader election and maintenance, periodic and resumable jobs, job and queue management, hooks, middleware, events, migrations, CLI tooling, worker threads, and test helpers. Requires Node.js 26 with native `Temporal`; job IDs are `bigint` and timestamps are `Temporal.Instant`. This replaces the insert-only 0.1 API; see [migrating from 0.1](./docs/migrating-from-0.1.md) and `riverqueue codemod-0.1` for upgrades. [PR #1443](https://github.com/riverqueue/river/pull/1443). +- JavaScript now implements full River client support for Postgres and SQLite, interoperating with Go and Rust in the same database. Includes workers, graceful stopping and cancellation, leader election and maintenance, periodic and resumable jobs, job and queue management, hooks, middleware, events, migrations, CLI tooling, worker threads, and test helpers. Requires Node.js 26 with native `Temporal`; job IDs are `bigint` and timestamps are `Temporal.Instant`. This replaces the insert-only 0.1 API; see [migrating from 0.1](./docs/migrating-from-0.1.md) and `riverqueue codemod-0.1` for upgrades. [PR #1443](https://github.com/riverqueue/river/pull/1443). ## [0.1.0] - 2026-06-01 diff --git a/js/README.md b/js/README.md index 84f5ae806..7b42e5fa1 100644 --- a/js/README.md +++ b/js/README.md @@ -1,6 +1,6 @@ # River for JavaScript and TypeScript -River is a fast, reliable background job system backed by PostgreSQL or SQLite. +River is a fast, reliable background job system backed by Postgres or SQLite. This implementation runs on Node.js and shares River's database protocol with River for Go and Rust, so services in all three languages can insert and work the same jobs in the same database. @@ -28,9 +28,9 @@ the same jobs in the same database. Keep every `@riverqueue/*` package on the same version as `riverqueue`; the packages declare that as an exact peer dependency. -## Quickstart with PostgreSQL +## Quickstart with Postgres -Install the core package, the PostgreSQL driver, migrations, and a validator +Install the core package, the Postgres driver, migrations, and a validator (any [Standard Schema](https://standardschema.dev) library works; this uses Zod): @@ -89,7 +89,7 @@ River never closes the pool you give it and never migrates on its own. Web servers that only insert jobs construct the same `Client` without `queues` or `workers` and never call `start()`. -For SQLite, install `@riverqueue/driver-sqlite` instead of the PostgreSQL +For SQLite, install `@riverqueue/driver-sqlite` instead of the Postgres packages; it uses Node's built-in `node:sqlite`. See the [SQLite driver](./driver/sqlite/README.md). @@ -98,10 +98,10 @@ packages; it uses Node's built-in `node:sqlite`. See the | Package | Purpose | | ---------------------------- | ------------------------------------------------------------------- | | `riverqueue` | Job definitions, insertion, workers, runtime, queries, and events | -| `@riverqueue/driver-pg` | PostgreSQL through `node-postgres` | +| `@riverqueue/driver-pg` | Postgres through `node-postgres` | | `@riverqueue/driver-prisma` | Insert jobs inside Prisma transactions | | `@riverqueue/driver-sqlite` | SQLite through Node's built-in `node:sqlite` | -| `@riverqueue/migrate` | PostgreSQL and SQLite migrations | +| `@riverqueue/migrate` | Postgres and SQLite migrations | | `@riverqueue/worker-threads` | Run CPU-bound handlers on worker threads | | `@riverqueue/test` | Test helpers for producers and workers | | `@riverqueue/cli` | The `riverqueue` command: migrations, benchmarks, and a 0.1 codemod | diff --git a/js/cli/README.md b/js/cli/README.md index 0107d10c8..32542c34a 100644 --- a/js/cli/README.md +++ b/js/cli/README.md @@ -25,21 +25,21 @@ Run `npx riverqueue --help` for every command, and `--database-url` selects the database: -- `postgres://…` or `postgresql://…` for PostgreSQL. Without - `--database-url`, PostgreSQL commands use the standard `PG*` environment +- `postgres://…` or `postgresql://…` for Postgres. Without + `--database-url`, Postgres commands use the standard `PG*` environment variables when `PGDATABASE` is set. - `sqlite://PATH` for SQLite, for example `sqlite:///var/lib/app/river.db` for an absolute path or `sqlite://river.db` for a relative one. Other common flags: -- `--schema NAME`: the PostgreSQL schema holding River's tables. It must match +- `--schema NAME`: the Postgres schema holding River's tables. It must match the `schema` given to `PgDriver`. - `--target-version N`: the version to end at. With `migrate-down`, `--target-version 0` reverts every migration and drops River's tables. - `--max-steps N`: run at most N migrations. - `--dry-run` and `--show-sql`: print what would run, with its SQL. -- `--statement-timeout DURATION`: PostgreSQL's `statement_timeout`, such as +- `--statement-timeout DURATION`: Postgres's `statement_timeout`, such as `30s` or `5m`. It defaults to a `statement_timeout` parameter in the URL, and otherwise to 10 seconds, as in River's Go CLI. @@ -80,7 +80,7 @@ describes what it rewrites and what it leaves for review. `riverqueue bench` inserts and works no-op jobs and reports throughput. It is destructive: it empties River's `river_job`, `river_leader`, `river_queue`, and `river_notification` tables and runs `VACUUM FULL` on `river_job`, so -use it only on a disposable PostgreSQL database. It requires an explicit +use it only on a disposable Postgres database. It requires an explicit `--database-url` (it never reads `PG*` variables or `DATABASE_URL`), and `--yes` unless it can ask for confirmation in an interactive terminal. diff --git a/js/cli/src/bench.ts b/js/cli/src/bench.ts index 8bec82e49..0ff3fbc98 100644 --- a/js/cli/src/bench.ts +++ b/js/cli/src/bench.ts @@ -73,7 +73,7 @@ benchmarks so results are comparable.`, }, "database-url": { description: - "PostgreSQL database to benchmark (required; its River tables are emptied)", + "Postgres database to benchmark (required; its River tables are emptied)", type: "string", valueName: "URL", }, @@ -83,7 +83,7 @@ benchmarks so results are comparable.`, valueName: "DURATION", }, "max-connections": { - description: `PostgreSQL pool size (default: ${DEFAULT_MAX_CONNECTIONS})`, + description: `Postgres pool size (default: ${DEFAULT_MAX_CONNECTIONS})`, type: "string", valueName: "N", }, @@ -100,7 +100,7 @@ benchmarks so results are comparable.`, }, schema: { description: - "PostgreSQL schema containing River's tables (default: the search_path)", + "Postgres schema containing River's tables (default: the search_path)", type: "string", valueName: "NAME", }, @@ -198,10 +198,7 @@ async function runBench( ): Promise { const location = parseDatabaseUrl("bench", options.databaseUrl, context.env); if (location.backend !== "postgres") { - throw new UsageError( - "only PostgreSQL databases can be benchmarked", - "bench" - ); + throw new UsageError("only Postgres databases can be benchmarked", "bench"); } const interactive = context.stdin.isTTY === true && context.stderr.isTTY === true; diff --git a/js/cli/src/database.ts b/js/cli/src/database.ts index 76158f5f4..942ce05df 100644 --- a/js/cli/src/database.ts +++ b/js/cli/src/database.ts @@ -27,10 +27,10 @@ const POSTGRES_DEFAULTS = { statement_timeout: 10_000, } as const; -/** `--statement-timeout`, accepted by commands that use PostgreSQL. */ +/** `--statement-timeout`, accepted by commands that use Postgres. */ export const STATEMENT_TIMEOUT_OPTION: OptionSpec = { description: - "PostgreSQL statement_timeout, such as 30s or 5m (default: a " + + "Postgres statement_timeout, such as 30s or 5m (default: a " + "statement_timeout parameter in --database-url, otherwise 10s)", type: "string", valueName: "DURATION", @@ -41,10 +41,10 @@ const SQLITE_BUSY_TIMEOUT_MS = 5_000; /** * Interpret `--database-url`. * - * `postgres://` and `postgresql://` URLs select PostgreSQL. `sqlite://PATH` + * `postgres://` and `postgresql://` URLs select Postgres. `sqlite://PATH` * selects SQLite, where `PATH` is a file path (`sqlite:///abs/river.db` or * `sqlite://relative/river.db`), `:memory:`, or a `file:` URL. Without a URL, - * PostgreSQL is configured from `PG*` environment variables when + * Postgres is configured from `PG*` environment variables when * `PGDATABASE` is set, as node-postgres and River's Go CLI do. */ export function parseDatabaseUrl( @@ -58,7 +58,7 @@ export function parseDatabaseUrl( } throw new UsageError( "--database-url is required unless PGDATABASE and other PG* " + - "environment variables configure PostgreSQL", + "environment variables configure Postgres", command ); } @@ -100,7 +100,7 @@ export function statementTimeoutValue( : parseDuration(command, "--statement-timeout", value); } -/** Open a PostgreSQL pool for a CLI command. */ +/** Open a Postgres pool for a CLI command. */ export function openPostgresPool( location: Extract, options: { @@ -136,7 +136,7 @@ export function openSqliteDatabase( } /** - * Describe a PostgreSQL target for confirmation prompts without exposing a + * Describe a Postgres target for confirmation prompts without exposing a * password. */ export function describePostgresTarget(connectionString: string): string { diff --git a/js/cli/src/migrate-commands.ts b/js/cli/src/migrate-commands.ts index 42a48c5e4..9d2513a42 100644 --- a/js/cli/src/migrate-commands.ts +++ b/js/cli/src/migrate-commands.ts @@ -47,7 +47,7 @@ const LINE_OPTION: OptionSpec = { const SCHEMA_OPTION: OptionSpec = { description: - "PostgreSQL schema containing River's tables (default: the search_path)", + "Postgres schema containing River's tables (default: the search_path)", type: "string", valueName: "NAME", }; @@ -113,7 +113,7 @@ Choose versions with --version (comma-separated or repeated) or --all, and a direction with --up or --down. With --all, down migrations print newest first. --exclude-version 1 skips the tables River uses to track its own migrations. No database connection is made: --database-url only selects -PostgreSQL (the default) or SQLite SQL. +Postgres (the default) or SQLite SQL. {program} migrate-get --version 3 --up > river_3.up.sql {program} migrate-get --all --exclude-version 1 --up > river.up.sql @@ -297,7 +297,7 @@ async function runMigrateGet( const backend = sqlDialect(command, stringValue(values, "database-url")); const schema = stringValue(values, "schema"); if (backend === "sqlite" && schema !== undefined) { - throw new UsageError("--schema only applies to PostgreSQL", command); + throw new UsageError("--schema only applies to Postgres", command); } const migrations = @@ -357,7 +357,7 @@ async function withMigrator( ["--statement-timeout", statementTimeoutMs], ] as const) { if (value !== undefined) { - throw new UsageError(`${flag} only applies to PostgreSQL`, command); + throw new UsageError(`${flag} only applies to Postgres`, command); } } const database = openSqliteDatabase(location); diff --git a/js/cli/src/run.integration.test.ts b/js/cli/src/run.integration.test.ts index b97382fb9..7d0f58120 100644 --- a/js/cli/src/run.integration.test.ts +++ b/js/cli/src/run.integration.test.ts @@ -26,7 +26,7 @@ async function invoke( return { exitCode, stderr, stdout }; } -describe("riverqueue with PostgreSQL", () => { +describe("riverqueue with Postgres", () => { let pool: pg.Pool; let schema: string; diff --git a/js/cli/src/run.test.ts b/js/cli/src/run.test.ts index b4fdd0daa..ffff46908 100644 --- a/js/cli/src/run.test.ts +++ b/js/cli/src/run.test.ts @@ -182,7 +182,7 @@ describe("argument errors", () => { "--schema", "river", ], - "--schema only applies to PostgreSQL", + "--schema only applies to Postgres", ], [ [ @@ -192,7 +192,7 @@ describe("argument errors", () => { "--statement-timeout", "5s", ], - "--statement-timeout only applies to PostgreSQL", + "--statement-timeout only applies to Postgres", ], [ ["migrate-up", "--database-url", "sqlite://:memory:", "--line", "mian"], @@ -250,7 +250,7 @@ describe("bench guards", () => { ], [ ["bench", "--database-url", "sqlite:///tmp/river.db", "--yes"], - "only PostgreSQL databases can be benchmarked", + "only Postgres databases can be benchmarked", ], [ [ @@ -405,7 +405,7 @@ describe("migrate-get", () => { "--schema", "s", ], - "--schema only applies to PostgreSQL", + "--schema only applies to Postgres", ], ])("rejects %j", async (argv, message) => { const result = await invoke(argv); diff --git a/js/cli/src/run.ts b/js/cli/src/run.ts index be18c34cb..0bebb7265 100644 --- a/js/cli/src/run.ts +++ b/js/cli/src/run.ts @@ -233,12 +233,12 @@ function programHelp(program: string): string { const width = Math.max(...commands.map(({ name }) => name.length)) + 2; return formatHelp({ description: ` -Command-line tools for River, the job queue for PostgreSQL and SQLite. +Command-line tools for River, the job queue for Postgres and SQLite. Commands: ${commands.map(({ name, summary }) => ` ${name.padEnd(width)}${summary}`).join("\n")} -Commands that use a database take --database-url. PostgreSQL commands other +Commands that use a database take --database-url. Postgres commands other than bench also read the standard PG* environment variables when PGDATABASE is set. Run "${program} --help" for a command's flags, and "${program} --version" for version information.`, diff --git a/js/docs/README.md b/js/docs/README.md index ad0e609d8..d392f3c7e 100644 --- a/js/docs/README.md +++ b/js/docs/README.md @@ -256,11 +256,11 @@ try { ``` Like River for Go, River runs its statements directly in your transaction and -opens no savepoint or nested transaction in it, which on PostgreSQL would cost +opens no savepoint or nested transaction in it, which on Postgres would cost a subtransaction for every call. When a call fails after River wrote to the database, for example because insert middleware or an `afterInsert` hook threw after the job was inserted, the write stays in your transaction, so roll it -back as above. On PostgreSQL a database error also aborts the transaction. To +back as above. On Postgres a database error also aborts the transaction. To recover from a failed call and continue the transaction, wrap the call in a savepoint of your own. Without `{ tx }`, River's own transaction rolls the whole call back. @@ -359,8 +359,8 @@ If the transaction rolls back, so does the completion, and River records the attempt from the handler's result as usual: a thrown error fails it and a normal return completes it. `new Workers()` types `completeTx` (and `ctx.client`) for node-postgres. Without it, `Workers` accepts the -transaction of any installed River driver, so with both the PostgreSQL and -SQLite drivers installed, passing a SQLite transaction to a PostgreSQL client's +transaction of any installed River driver, so with both the Postgres and +SQLite drivers installed, passing a SQLite transaction to a Postgres client's handler would compile and then fail at runtime. ## Run workers @@ -450,7 +450,7 @@ after all others ascending and before all others descending. River never exposes a lossy database value: - job IDs and other 64-bit integers are `bigint`; -- timestamps are `Temporal.Instant`, with PostgreSQL's microseconds; and +- timestamps are `Temporal.Instant`, with Postgres's microseconds; and - job args and metadata are JSON, typed as `JsonValue`/`JsonObject`. At every JSON boundary River rejects `bigint`, non-finite numbers, integers @@ -492,7 +492,7 @@ JSON-safe copy of a job (IDs as decimal strings, instants as ISO strings) and Runnable examples: -- [PostgreSQL worker](../examples/pg-worker/README.md) +- [Postgres worker](../examples/pg-worker/README.md) - [node-postgres insertion and transactions](../examples/node-postgres/README.md) - [Prisma insertion and transactions](../examples/prisma/README.md) - [SQLite worker](../examples/sqlite-worker/README.md) diff --git a/js/docs/databases.md b/js/docs/databases.md index 9bc3da5f6..fd0f3c092 100644 --- a/js/docs/databases.md +++ b/js/docs/databases.md @@ -4,11 +4,11 @@ Each database lives in its own driver package, so an application installs only the database it uses. The core API never exposes one database's types as universal: a client's transaction type comes from its driver. -## PostgreSQL +## Postgres `@riverqueue/driver-pg` is the complete `node-postgres` runtime. The application owns the pool; River never ends it. River reads timestamps in -PostgreSQL's default ISO `DateStyle` and rejects any other with a +Postgres's default ISO `DateStyle` and rejects any other with a `ConfigurationError`; a server configured otherwise needs `DateStyle=ISO` for River's connections, such as through the pool's `options: "-c DateStyle=ISO"`. @@ -44,7 +44,7 @@ migrator, and CLI. ### YugabyteDB -River's PostgreSQL drivers detect YugabyteDB from the server's `version()` +River's Postgres drivers detect YugabyteDB from the server's `version()` the first time they need to, and cache what they find for the driver's lifetime, like River for Go. YugabyteDB has no `xmax`, so a unique insertion marks each row with a `river:unique_nonce` metadata value instead, as on @@ -55,17 +55,17 @@ claims new jobs every queue's `pollInterval`, rereads queue pauses, resumes, and metadata, and checks its running jobs for cancellations every `queueControlPollInterval` (two seconds by default), including while a stop drains them. After enabling notifications, construct a new driver, for -example by restarting, so River detects them. On PostgreSQL 18 and later, +example by restarting, so River detects them. On Postgres 18 and later, unique insertions read the conflicting row through `RETURNING OLD`. -On PostgreSQL, `@riverqueue/migrate` serializes concurrent migrators with a +On Postgres, `@riverqueue/migrate` serializes concurrent migrators with a transaction-scoped advisory lock. YugabyteDB has advisory locks only behind a preview flag, so there, like River for Go's migrator everywhere, it takes no lock; run one migrator at a time. `@riverqueue/driver-prisma` is deliberately producer-only. It lets application writes and job insertion share a Prisma transaction, but it does not claim or -work jobs. Use the PostgreSQL runtime in worker services. +work jobs. Use the Postgres runtime in worker services. ## SQLite diff --git a/js/docs/deployment.md b/js/docs/deployment.md index 6d4e27ec0..c9b4f1d0e 100644 --- a/js/docs/deployment.md +++ b/js/docs/deployment.md @@ -63,7 +63,7 @@ language's kinds on every client that may lead. A client claims only from its own queues, so such a placeholder handler never runs; it only lets the rescuer apply the normal retry policy. Give it the same timeout as the real worker so the rescuer waits just as long before treating the job as stuck. This applies -to both PostgreSQL and SQLite. +to both Postgres and SQLite. JavaScript uses `bigint` and `Temporal.Instant` so it does not silently truncate values produced by Go or Rust. Serialize with River's JSON-safe helpers at HTTP, diff --git a/js/docs/development.md b/js/docs/development.md index 4951a28e1..7de378c24 100644 --- a/js/docs/development.md +++ b/js/docs/development.md @@ -67,9 +67,9 @@ consumer with Node's built-in `node --test`, so plain JavaScript exercises the installed tarballs with no transpiler or workspace alias in between: SQLite and worker-thread jobs end to end with exact int64 args, one shared `riverqueue` instance and error class hierarchy across packages, `require(esm)`, subpath -exports, the CLI, and the test helpers. Its PostgreSQL tests run in a throwaway +exports, the CLI, and the test helpers. Its Postgres tests run in a throwaway schema when `DATABASE_URL` is set. Database-free examples also run in this -gate. `package:examples` runs the same packed examples with PostgreSQL when +gate. `package:examples` runs the same packed examples with Postgres when `DATABASE_URL` is set. Neither command publishes anything. `package:check` and `migration:legacy` reject archive paths that escape the @@ -150,7 +150,7 @@ recorded goldens establish. It has no threshold and is not a CI gate. ## Integration tests -Integration tests run against a real PostgreSQL database with River's schema. +Integration tests run against a real Postgres database with River's schema. Create a disposable test database, build the workspace, and apply the exact generated migrations from this checkout: @@ -194,7 +194,7 @@ and on `js/v*` release tags. Each job installs the official Node.js build from cover build, both type-check lanes, generated migrations (compared with River's sources), API reports, TypeDoc, README snippets, the 0.1 fixture, lint, formatting, licenses, packed archives and examples, unit tests on Node 26.0.0 -and the current Node 26 release, and integration tests on PostgreSQL 14 +and the current Node 26 release, and integration tests on Postgres 14 through 18. Unit tests compare unique keys, protocol values, notification dispatch, @@ -204,7 +204,7 @@ files the Rust port reads. They aren't committed: `make test/js` generates them first, so Go is needed to run the unit tests, and `pnpm run test` needs a prior `make generate/fixtures` from the repository root. A missing fixture fails its test. `make test/js/conformance` runs just these checks, including -both drivers' notification adapters without a PostgreSQL server. The two +both drivers' notification adapters without a Postgres server. The two raw JSON unique-key cases involving duplicate keys or integer-key insertion order are Rust-only because JavaScript objects cannot preserve them. diff --git a/js/docs/migrating-from-0.1.md b/js/docs/migrating-from-0.1.md index 6ecb621b8..3887c454a 100644 --- a/js/docs/migrating-from-0.1.md +++ b/js/docs/migrating-from-0.1.md @@ -168,7 +168,7 @@ passed to `new Client()` is rejected; use `createTestClient` from would lose precision. Use `id.toString()` for logs, URLs, and JSON. Review any ID arithmetic by hand rather than converting back to `number`. -Every timestamp on a job row is a `Temporal.Instant`. It keeps PostgreSQL's +Every timestamp on a job row is a `Temporal.Instant`. It keeps Postgres's microseconds and carries no local time zone, so review code that relied on `Date`'s local-time methods. Convert with `new Date(instant.epochMilliseconds)` where an API needs a `Date`. @@ -201,7 +201,7 @@ with the jobs. River needs a connection of its own for that: transaction on the root client's `$transaction`, so construct it with the root `PrismaClient`, not a transaction client. -On PostgreSQL, the transaction adds a `BEGIN` and a `COMMIT` round trip to +On Postgres, the transaction adds a `BEGIN` and a `COMMIT` round trip to each call that 0.1 ran as a single statement. To insert many jobs, pass them to one `insertMany` call. @@ -212,7 +212,7 @@ build's `insertManyFast` should insert large batches with one `insertMany` call instead, which differs in three ways: it resolves with one result per row rather than a count; a unique conflict is reported as that row's `status: "duplicate"` instead of being skipped (SQLite) or failing the whole -batch (PostgreSQL); and insert middleware and hooks run for every row. +batch (Postgres); and insert middleware and hooks run for every row. ## Prisma diff --git a/js/docs/testing.md b/js/docs/testing.md index a8390a87b..42fedf9cf 100644 --- a/js/docs/testing.md +++ b/js/docs/testing.md @@ -142,6 +142,6 @@ it("works a job end to end", async () => { `leaderElectionDisabled: true` keeps leader election and maintenance services out of short tests. A queue's `pollInterval` can't be shorter than its `fetchCooldown` (the client's `fetchCooldown`, 100 ms by default), so a test -that polls faster lowers both. Use the PostgreSQL driver against a disposable -database when a test depends on PostgreSQL behavior (`LISTEN`/`NOTIFY`, custom +that polls faster lowers both. Use the Postgres driver against a disposable +database when a test depends on Postgres behavior (`LISTEN`/`NOTIFY`, custom schemas, or concurrent clients). diff --git a/js/driver/pg/README.md b/js/driver/pg/README.md index 61d8db304..792c66989 100644 --- a/js/driver/pg/README.md +++ b/js/driver/pg/README.md @@ -1,6 +1,6 @@ # `@riverqueue/driver-pg` -This package is River's complete PostgreSQL backend for Node.js 26 and newer. +This package is River's complete Postgres backend for Node.js 26 and newer. It accepts a caller-owned `pg.Pool`, performs insertion and runtime operations, and implements notifications, leadership, maintenance, and queue control. @@ -70,7 +70,7 @@ and queue changes it may have missed. When River abandons an in-flight statement, such as a completion query that exceeded its 10 second bound or a reindex interrupted by shutdown, it destroys -that connection and asks PostgreSQL to cancel the statement with +that connection and asks Postgres to cancel the statement with `pg_cancel_backend` from another pooled connection. The cancellation only targets a backend still running that River statement. A statement can still commit before the cancellation arrives; River's attempt-identity guard keeps @@ -103,7 +103,7 @@ so npm rejects a mismatched pair instead of loading two copies. River parses the values its queries return with its own parsers, so changes an application makes to node-postgres's global parsers (`pg.types.setTypeParser`) -don't affect it. It reads timestamps in PostgreSQL's default `DateStyle` of +don't affect it. It reads timestamps in Postgres's default `DateStyle` of `ISO`; a session with another `DateStyle` fails with a clear error. TypeScript users need TypeScript 6.0 or newer and `@types/node` and `@types/pg`, diff --git a/js/driver/pg/etc/driver-pg.api.md b/js/driver/pg/etc/driver-pg.api.md index 28e111272..587c63f32 100644 --- a/js/driver/pg/etc/driver-pg.api.md +++ b/js/driver/pg/etc/driver-pg.api.md @@ -37,9 +37,9 @@ export declare class PgDriver { ## `PgDriverOptions` ```ts -/** Construction options owned by the PostgreSQL backend. */ +/** Construction options owned by the Postgres backend. */ export interface PgDriverOptions { - /** PostgreSQL schema containing River's tables and functions. */ + /** Postgres schema containing River's tables and functions. */ schema?: string; } ``` diff --git a/js/driver/pg/src/database.ts b/js/driver/pg/src/database.ts index 9e19460bc..8d272772e 100644 --- a/js/driver/pg/src/database.ts +++ b/js/driver/pg/src/database.ts @@ -29,7 +29,7 @@ import { PG_EXACT_TYPES } from "./exact-types.js"; import { abortablePromise, PgClientLease } from "./lease.js"; import type { PgOperationOptions } from "./types.js"; -/** PostgreSQL's maximum identifier length (`NAMEDATALEN - 1`). */ +/** Postgres's maximum identifier length (`NAMEDATALEN - 1`). */ export const POSTGRES_IDENTIFIER_MAX_BYTES = 63; /** How long an abort waits for a pooled connection to cancel its statement. */ @@ -85,7 +85,7 @@ export class PgDatabase { if (row === undefined) { throw databaseError( "detectCapabilities", - "PostgreSQL returned no server capabilities" + "Postgres returned no server capabilities" ); } // node-postgres reads timestamps as text, which River parses in the ISO @@ -93,7 +93,7 @@ export class PgDatabase { if (typeof row.date_style !== "string" || !/^ISO\b/.test(row.date_style)) { throw configurationError( "detectCapabilities", - `River needs PostgreSQL's DateStyle to be ISO, not ${JSON.stringify(row.date_style)}; ` + + `River needs Postgres's DateStyle to be ISO, not ${JSON.stringify(row.date_style)}; ` + "set it for River's connections, for example with the Pool option " + "options: \"-c DateStyle=ISO\", or with ALTER ROLE ... SET DateStyle = 'ISO'" ); @@ -182,7 +182,7 @@ export class PgDatabase { if (cause instanceof RiverError) throw cause; throw databaseError( operation, - `PostgreSQL operation ${operation} failed`, + `Postgres operation ${operation} failed`, cause ); } @@ -233,7 +233,7 @@ export class PgDatabase { /** * Like {@link PgDatabase.query}, but stop waiting when `options.signal` * aborts. Without a caller transaction the statement runs on its own - * leased pool connection, which an abort destroys, first asking PostgreSQL + * leased pool connection, which an abort destroys, first asking Postgres * to cancel a statement that starts with `cancelPrefix`. */ async queryAbortable( @@ -255,7 +255,7 @@ export class PgDatabase { if (options.tx !== undefined || this.pool === null) { // River cannot destroy a caller-owned connection. Cancellation still // bounds the caller's wait; pool-backed runtime queries below also end - // their PostgreSQL session so blocked work cannot continue in the pool. + // their Postgres session so blocked work cannot continue in the pool. return abortablePromise( this.query( operation, @@ -284,7 +284,7 @@ export class PgDatabase { let queryActive = true; const abort = (): void => { if (!queryActive) return; - // Ask PostgreSQL to stop the statement as well: a destroyed socket is + // Ask Postgres to stop the statement as well: a destroyed socket is // only noticed once the statement finishes, so a lock wait would keep // running and could still commit. if (cancelPrefix !== undefined) this.cancelBackend(client, cancelPrefix); diff --git a/js/driver/pg/src/driver.integration.test.ts b/js/driver/pg/src/driver.integration.test.ts index 33cc4203c..194549a1f 100644 --- a/js/driver/pg/src/driver.integration.test.ts +++ b/js/driver/pg/src/driver.integration.test.ts @@ -81,7 +81,7 @@ describe("PgDriver integration", () => { driver = testPgDriver(pool); // Maintenance operations act on every row, not just this file's kinds, // so start from empty River tables whatever ran against the database - // before (such as the packed PostgreSQL examples). + // before (such as the packed Postgres examples). await pool.query("TRUNCATE river_job, river_leader, river_queue"); }); @@ -146,7 +146,7 @@ describe("PgDriver integration", () => { }); it("truncates sub-microsecond timestamps like Go instead of rounding", async () => { - // PostgreSQL would round `.0000019` up to `.000002`; Go's pgx truncates. + // Postgres would round `.0000019` up to `.000002`; Go's pgx truncates. const scheduledAt = Temporal.Instant.from("2026-08-30T12:00:00.0000019Z"); const createdAt = Temporal.Instant.from("2026-08-30T11:00:00.0000015Z"); @@ -168,7 +168,7 @@ describe("PgDriver integration", () => { it("keeps a reinserted job's creation time and encoded arguments", async () => { const createdAt = Temporal.Instant.from("2026-01-02T03:04:05.123456Z"); - // PostgreSQL's clock rounds to microseconds. + // Postgres's clock rounds to microseconds. const before = Temporal.Now.instant().subtract({ seconds: 1 }); const params = [ @@ -236,7 +236,7 @@ describe("PgDriver integration", () => { ); }); - it("decodes exact timestamps nested in PostgreSQL jsonb arrays", async () => { + it("decodes exact timestamps nested in Postgres jsonb arrays", async () => { const inserted = await driver.jobInsert( insertParams(`${filePrefix}_attempt_error`) ); @@ -284,7 +284,7 @@ describe("PgDriver integration", () => { insertParams(`${filePrefix}_batch_unique`, unique), ]) ).rejects.toMatchObject({ - // PostgreSQL's cardinality_violation: ON CONFLICT DO UPDATE can't + // Postgres's cardinality_violation: ON CONFLICT DO UPDATE can't // affect a row twice, as for River for Go's batch. cause: expect.objectContaining({ code: "21000" }), }); @@ -347,7 +347,7 @@ describe("PgDriver integration", () => { expect(stored.rows).toEqual([{ kind: jobA.kind }]); }); - it("ordinarily inserts beyond PostgreSQL's bind-parameter limit", async () => { + it("ordinarily inserts beyond Postgres's bind-parameter limit", async () => { const params = Array.from({ length: 6_000 }, (_, index) => insertParams(`${filePrefix}_ordinary_bulk`, { args: { index }, diff --git a/js/driver/pg/src/driver.test.ts b/js/driver/pg/src/driver.test.ts index 1f6d149ea..ec5d186e8 100644 --- a/js/driver/pg/src/driver.test.ts +++ b/js/driver/pg/src/driver.test.ts @@ -71,7 +71,7 @@ function mockPgClient() { rows: [] as Record[], }; const query = vi.fn(async (config: QueryConfig) => { - // Answer the driver's one-time server detection as PostgreSQL 17, + // Answer the driver's one-time server detection as Postgres 17, // outside the statements each test inspects. // LISTEN and ping queries are plain SQL strings, not query configs. if ( @@ -161,7 +161,7 @@ describe("PgDriver surface", () => { }); }); -describe("PostgreSQL exact type parsing", () => { +describe("Postgres exact type parsing", () => { it("preserves exact JSON and JSONB numbers", () => { const parseJson = PG_EXACT_TYPES.getTypeParser(114, "text"); @@ -213,7 +213,7 @@ describe("PostgreSQL exact type parsing", () => { ); }); - it("decodes binary timestamptz values at PostgreSQL's epoch", () => { + it("decodes binary timestamptz values at Postgres's epoch", () => { const parser = PG_EXACT_TYPES.getTypeParser(1184, "binary"); const encoded = Buffer.alloc(8); encoded.writeBigInt64BE(1n); @@ -268,7 +268,7 @@ describe("PostgreSQL exact type parsing", () => { } }); - it("rejects PostgreSQL timestamp infinity", () => { + it("rejects Postgres timestamp infinity", () => { const parser = PG_EXACT_TYPES.getTypeParser(1184, "text"); expect(() => parser("infinity")).toThrow(/infinite timestamps/); @@ -893,7 +893,7 @@ describe("PgDriver", () => { await vi.advanceTimersByTimeAsync(1_000); // The caller resubscribes; the listener doesn't reconnect on its own. await expect(failed).resolves.toMatchObject({ - message: "PostgreSQL LISTEN connection did not answer a ping", + message: "Postgres LISTEN connection did not answer a ping", name: "DatabaseOperationError", }); expect(halfOpen.release).toHaveBeenCalledWith(true); @@ -941,7 +941,7 @@ describe("PgDriver", () => { await vi.advanceTimersByTimeAsync(1); await expect(failed).resolves.toMatchObject({ message: - "PostgreSQL LISTEN connection setup did not finish within 1000 ms", + "Postgres LISTEN connection setup did not finish within 1000 ms", name: "DatabaseOperationError", }); expect(halfOpen.release).toHaveBeenCalledWith(true); @@ -1513,7 +1513,7 @@ describe("PgDriver", () => { }), null, ]); - // Truncated to PostgreSQL's microseconds like Go's pgx. + // Truncated to Postgres's microseconds like Go's pgx. expect(config.values![5]).toEqual([ "2026-08-30T14:00:01.123456Z", null, @@ -1777,7 +1777,7 @@ describe("PgDriver", () => { await expect(promise).rejects.toMatchObject({ backend: "postgres", code: "database", - message: "PostgreSQL operation jobGet failed", + message: "Postgres operation jobGet failed", operation: "jobGet", }); await expect(promise).rejects.not.toHaveProperty("sql"); diff --git a/js/driver/pg/src/driver.ts b/js/driver/pg/src/driver.ts index 385c0beb9..38b6c5e08 100644 --- a/js/driver/pg/src/driver.ts +++ b/js/driver/pg/src/driver.ts @@ -157,7 +157,7 @@ export class PgRuntime implements RuntimeDriver { } /** - * The configured PostgreSQL schema containing River's tables, or undefined + * The configured Postgres schema containing River's tables, or undefined * when River uses the connection's `search_path`. */ get schema(): string | undefined { @@ -175,7 +175,7 @@ export class PgRuntime implements RuntimeDriver { if (this.pool === null) { throw unsupportedError( "runtime", - "the PostgreSQL worker runtime requires PgDriver to be constructed with a Pool" + "the Postgres worker runtime requires PgDriver to be constructed with a Pool" ); } const minimumPoolSize = @@ -186,7 +186,7 @@ export class PgRuntime implements RuntimeDriver { if (this.pool.options.max < minimumPoolSize) { throw configurationError( "runtimeStartPreflight", - `the PostgreSQL worker runtime requires Pool max to be at least ${minimumPoolSize} for the enabled worker, notification, maintenance, and reindex services` + `the Postgres worker runtime requires Pool max to be at least ${minimumPoolSize} for the enabled worker, notification, maintenance, and reindex services` ); } } @@ -591,7 +591,7 @@ export class PgRuntime implements RuntimeDriver { } /** - * Send one or more PostgreSQL notifications on a River topic. + * Send one or more Postgres notifications on a River topic. * * @internal */ @@ -604,7 +604,7 @@ export class PgRuntime implements RuntimeDriver { } /** - * Yield namespaced PostgreSQL notifications with reconnect recovery. + * Yield namespaced Postgres notifications with reconnect recovery. * * Notifications are hints only: callers must retain polling because NOTIFY * is not durable and a connection may be between reconnect attempts. An @@ -929,13 +929,13 @@ function validateSchema(value: string): void { if (!RIVER_SCHEMA_RE.test(value)) { throw configurationError( "construct", - "PostgreSQL schema must start with a letter or underscore and contain only letters, numbers, and underscores" + "Postgres schema must start with a letter or underscore and contain only letters, numbers, and underscores" ); } if (Buffer.byteLength(value, "utf8") > RIVER_SCHEMA_MAX_BYTES) { throw configurationError( "construct", - `PostgreSQL schema must not exceed ${RIVER_SCHEMA_MAX_BYTES} bytes so River notification topics remain valid` + `Postgres schema must not exceed ${RIVER_SCHEMA_MAX_BYTES} bytes so River notification topics remain valid` ); } } diff --git a/js/driver/pg/src/errors.ts b/js/driver/pg/src/errors.ts index 654dfbaa8..3857ca4a4 100644 --- a/js/driver/pg/src/errors.ts +++ b/js/driver/pg/src/errors.ts @@ -5,10 +5,10 @@ import { UnsupportedCapabilityError, } from "riverqueue"; -/** Backend name recorded on PostgreSQL errors. */ +/** Backend name recorded on Postgres errors. */ const POSTGRES_BACKEND = "postgres"; -/** A failed PostgreSQL operation, retryable when the cause is transient. */ +/** A failed Postgres operation, retryable when the cause is transient. */ export function databaseError( operation: string, message: string, @@ -22,7 +22,7 @@ export function databaseError( }); } -/** Invalid PostgreSQL driver configuration or input. */ +/** Invalid Postgres driver configuration or input. */ export function configurationError( operation: string, message: string @@ -32,7 +32,7 @@ export function configurationError( }); } -/** A PostgreSQL operation unavailable for the configured connection. */ +/** A Postgres operation unavailable for the configured connection. */ export function unsupportedError( capability: string, message: string diff --git a/js/driver/pg/src/exact-types.ts b/js/driver/pg/src/exact-types.ts index 90f97e740..a6a001386 100644 --- a/js/driver/pg/src/exact-types.ts +++ b/js/driver/pg/src/exact-types.ts @@ -47,7 +47,7 @@ const TEXT_PARSERS: ReadonlyMap unknown> = new Map< ]); /** - * Query-scoped PostgreSQL parsers for River's exact persisted values. + * Query-scoped Postgres parsers for River's exact persisted values. * * This object delegates unknown OIDs to node-postgres and never mutates its * process-global parser registry. It is safe to use with caller-owned pools. @@ -87,7 +87,7 @@ export const PG_EXACT_TYPES: CustomTypesConfig = { function parseBinaryInt8(value: Buffer): bigint { if (value.byteLength !== 8) { throw new RangeError( - `invalid PostgreSQL int8 binary length: ${value.byteLength}` + `invalid Postgres int8 binary length: ${value.byteLength}` ); } return value.readBigInt64BE(); @@ -99,9 +99,7 @@ function parseBinaryTimestamptz(value: Buffer): Temporal.Instant { postgresMicroseconds === 9_223_372_036_854_775_807n || postgresMicroseconds === -9_223_372_036_854_775_808n ) { - throw new RangeError( - "PostgreSQL infinite timestamps are not River instants" - ); + throw new RangeError("Postgres infinite timestamps are not River instants"); } const unixNanoseconds = @@ -120,9 +118,7 @@ function parseTextArray(value: string): string[] { function parseTextBool(value: string): boolean { if (value === "t") return true; if (value === "f") return false; - throw new RangeError( - `invalid PostgreSQL bool text: ${JSON.stringify(value)}` - ); + throw new RangeError(`invalid Postgres bool text: ${JSON.stringify(value)}`); } /** Decode `bytea` in either `bytea_output` format, `hex` or `escape`. */ @@ -130,7 +126,7 @@ function parseTextBytea(value: string): Buffer { if (value.startsWith("\\x")) { const hex = value.slice(2); if (!/^(?:[0-9a-fA-F]{2})*$/.test(hex)) { - throw new RangeError("invalid PostgreSQL bytea hex text"); + throw new RangeError("invalid Postgres bytea hex text"); } return Buffer.from(hex, "hex"); } @@ -139,7 +135,7 @@ function parseTextBytea(value: string): Buffer { const character = value[index]; if (character !== "\\") { const code = value.charCodeAt(index); - if (code > 0xff) throw new RangeError("invalid PostgreSQL bytea text"); + if (code > 0xff) throw new RangeError("invalid Postgres bytea text"); bytes.push(code); } else if (value[index + 1] === "\\") { bytes.push(0x5c); @@ -147,7 +143,7 @@ function parseTextBytea(value: string): Buffer { } else { const octal = value.slice(index + 1, index + 4); if (!/^[0-3][0-7]{2}$/.test(octal)) { - throw new RangeError("invalid PostgreSQL bytea escape text"); + throw new RangeError("invalid Postgres bytea escape text"); } bytes.push(Number.parseInt(octal, 8)); index += 3; @@ -159,7 +155,7 @@ function parseTextBytea(value: string): Buffer { function parseTextInt4(value: string): number { if (!/^-?(0|[1-9]\d*)$/.test(value)) { throw new RangeError( - `invalid PostgreSQL integer text: ${JSON.stringify(value)}` + `invalid Postgres integer text: ${JSON.stringify(value)}` ); } return Number.parseInt(value, 10); @@ -168,7 +164,7 @@ function parseTextInt4(value: string): number { function parseTextInt8(value: string): bigint { if (!/^-?(0|[1-9]\d*)$/.test(value)) { throw new RangeError( - `invalid PostgreSQL int8 text: ${JSON.stringify(value)}` + `invalid Postgres int8 text: ${JSON.stringify(value)}` ); } return BigInt(value); @@ -176,9 +172,7 @@ function parseTextInt8(value: string): bigint { function parseTextTimestamptz(value: string): Temporal.Instant { if (value === "infinity" || value === "-infinity") { - throw new RangeError( - "PostgreSQL infinite timestamps are not River instants" - ); + throw new RangeError("Postgres infinite timestamps are not River instants"); } const match = @@ -187,7 +181,7 @@ function parseTextTimestamptz(value: string): Temporal.Instant { ); if (match === null) { throw new RangeError( - `invalid PostgreSQL timestamptz text: ${JSON.stringify(value)}` + `invalid Postgres timestamptz text: ${JSON.stringify(value)}` ); } @@ -218,7 +212,7 @@ function isoYearFromBc(value: string): string { } /** - * Write a PostgreSQL offset as `±HH:MM` or `±HH:MM:SS`. Historical local + * Write a Postgres offset as `±HH:MM` or `±HH:MM:SS`. Historical local * mean times, such as `+05:53:28`, have seconds. */ function normalizeOffset(value: string): string { diff --git a/js/driver/pg/src/pilot.integration.test.ts b/js/driver/pg/src/pilot.integration.test.ts index edafc720c..eb583a816 100644 --- a/js/driver/pg/src/pilot.integration.test.ts +++ b/js/driver/pg/src/pilot.integration.test.ts @@ -34,7 +34,7 @@ const companionTable = `${prefix}_companion`; class CompanionClient extends PilotClient {} -describe("PostgreSQL pilot", () => { +describe("Postgres pilot", () => { let admin: pg.Pool; beforeAll(async () => { @@ -896,7 +896,7 @@ describe("PostgreSQL pilot", () => { } }); - it("runs producer sessions and services through PostgreSQL transactions", async () => { + it("runs producer sessions and services through Postgres transactions", async () => { const own = `${prefix}_own_claim`; const standard = `${prefix}_standard_claim`; const finished = new Map(); @@ -1454,7 +1454,7 @@ describe("PostgreSQL pilot", () => { const run = await client.start(); await run.stop(); - // PostgreSQL's rendering of the stored JSONB, which keeps `1.0` and + // Postgres's rendering of the stored JSONB, which keeps `1.0` and // orders keys by length. expect(texts).toEqual(['{"scale": 100, "retries": 1.0}']); }); @@ -1811,7 +1811,7 @@ describe("PostgreSQL pilot", () => { // A write directly in the caller's transaction, so that even one // savepoint around all of River's writes would be detected. await note(tx, "application"); - // More than PostgreSQL's cached subtransaction ID limit. + // More than Postgres's cached subtransaction ID limit. const ids: bigint[] = []; for (let index = 0; index < 70; index++) { ids.push((await client.insert(job, {}, { tx })).job.id); diff --git a/js/driver/pg/src/pilot.ts b/js/driver/pg/src/pilot.ts index 8b1f6895d..51b5c01ee 100644 --- a/js/driver/pg/src/pilot.ts +++ b/js/driver/pg/src/pilot.ts @@ -1,5 +1,5 @@ /** - * The PostgreSQL database River gives a client's pilot: pool connections, + * The Postgres database River gives a client's pilot: pool connections, * transactions, and the claim and notification statements a * companion runs inside its own transactions. */ diff --git a/js/driver/pg/src/runtime.integration.test.ts b/js/driver/pg/src/runtime.integration.test.ts index 3477486b8..dbaafc6a8 100644 --- a/js/driver/pg/src/runtime.integration.test.ts +++ b/js/driver/pg/src/runtime.integration.test.ts @@ -35,7 +35,7 @@ function recordingLogger(entries: LogEntry[]): Logger { }; } -describe("PostgreSQL runtime resilience", () => { +describe("Postgres runtime resilience", () => { let admin: pg.Pool; beforeAll(async () => { @@ -113,7 +113,7 @@ describe("PostgreSQL runtime resilience", () => { await expect(client.insert(job, {})).rejects.toMatchObject({ message: expect.stringContaining( - 'River needs PostgreSQL\'s DateStyle to be ISO, not "SQL, DMY"' + 'River needs Postgres\'s DateStyle to be ISO, not "SQL, DMY"' ), name: "ConfigurationError", }); @@ -266,7 +266,7 @@ describe("PostgreSQL runtime resilience", () => { } }); - it("bounds concurrent work to the caller-owned PostgreSQL pool", async () => { + it("bounds concurrent work to the caller-owned Postgres pool", async () => { const applicationName = `${filePrefix}_pool`; const pool = new pg.Pool({ application_name: applicationName, diff --git a/js/driver/pg/src/sql/jobs.ts b/js/driver/pg/src/sql/jobs.ts index 78e485c8b..7d0c9aa86 100644 --- a/js/driver/pg/src/sql/jobs.ts +++ b/js/driver/pg/src/sql/jobs.ts @@ -531,7 +531,7 @@ export async function jobList( ); const jobState = db.type("river_job_state"); // Like River's Go list builder: equality on a single state lets - // PostgreSQL use an index's time ordering (ANY does not fix the state), + // Postgres use an index's time ordering (ANY does not fix the state), // and an explicit non-null finalized time matches the partial index for // finalized states. const singleState = @@ -636,7 +636,7 @@ export async function jobInsert( if (result === undefined) { throw databaseError( "jobInsert", - "PostgreSQL returned no row for an inserted job" + "Postgres returned no row for an inserted job" ); } return result; @@ -760,7 +760,7 @@ export async function jobInsertMany( if (result.rows.length !== params.length) { throw databaseError( "jobInsertMany", - `PostgreSQL returned ${result.rows.length} rows for ${params.length} inserts` + `Postgres returned ${result.rows.length} rows for ${params.length} inserts` ); } return result.rows.map((row, index) => { diff --git a/js/driver/pg/src/sql/maintenance.ts b/js/driver/pg/src/sql/maintenance.ts index 01d1d30f1..390800c3c 100644 --- a/js/driver/pg/src/sql/maintenance.ts +++ b/js/driver/pg/src/sql/maintenance.ts @@ -294,7 +294,7 @@ export async function maintenanceLeaderAcquire( held: RuntimeLeader | null, signal?: AbortSignal ): Promise { - // PostgreSQL's clock is authoritative for cross-host lease expiry. The + // Postgres's clock is authoritative for cross-host lease expiry. The // runtime keeps a separate monotonic local trust deadline. Like Go River, // only the held term is renewed and an unexpired term is never adopted, // even one with this client's leader ID. @@ -600,7 +600,7 @@ export async function maintenanceReindex( if (db.pool === null) { throw unsupportedError( "maintenance", - "PostgreSQL reindex maintenance requires a Pool" + "Postgres reindex maintenance requires a Pool" ); } if ( @@ -719,7 +719,7 @@ async function withMaintenanceLeader( if (db.pool === null) { throw unsupportedError( "maintenance", - "PostgreSQL maintenance requires a Pool" + "Postgres maintenance requires a Pool" ); } batch?.signal.throwIfAborted(); @@ -888,7 +888,7 @@ function validateIndexName(value: string): void { ) { throw configurationError( "index", - `PostgreSQL index names must contain 1 to ${POSTGRES_IDENTIFIER_MAX_BYTES} bytes without NUL` + `Postgres index names must contain 1 to ${POSTGRES_IDENTIFIER_MAX_BYTES} bytes without NUL` ); } } diff --git a/js/driver/pg/src/sql/notify.ts b/js/driver/pg/src/sql/notify.ts index 5fa87e6e4..8f295b946 100644 --- a/js/driver/pg/src/sql/notify.ts +++ b/js/driver/pg/src/sql/notify.ts @@ -48,7 +48,7 @@ export function notifyInsert( ); } -/** Send one or more PostgreSQL notifications on a River topic. */ +/** Send one or more Postgres notifications on a River topic. */ export async function notifyMany( db: PgDatabase, topic: string, @@ -72,7 +72,7 @@ export async function notifyMany( } /** - * Yield namespaced PostgreSQL notifications from one LISTEN connection. + * Yield namespaced Postgres notifications from one LISTEN connection. * * Notifications are hints only: callers must retain polling because NOTIFY * is not durable. An idle connection is pinged every five seconds, like @@ -96,7 +96,7 @@ export async function* listen( if (db.pool === null) { throw unsupportedError( "listen", - "PostgreSQL LISTEN requires constructing PgDriver with a Pool" + "Postgres LISTEN requires constructing PgDriver with a Pool" ); } if (topics.length === 0 || signal.aborted) return; @@ -111,7 +111,7 @@ export async function* listen( setupTimeout.abort( databaseError( "listen", - `PostgreSQL LISTEN connection setup did not finish within ${setupTimeoutMs} ms` + `Postgres LISTEN connection setup did not finish within ${setupTimeoutMs} ms` ) ); }, setupTimeoutMs); @@ -352,7 +352,7 @@ async function currentSchema(client: PgQueryable): Promise { if (typeof schema !== "string" || schema.length === 0) { throw databaseError( "listen", - "PostgreSQL returned no current schema for LISTEN" + "Postgres returned no current schema for LISTEN" ); } return schema; @@ -372,13 +372,13 @@ function namespacedChannel(schema: string, topic: string): string { if (topic.length === 0 || topic.includes("\0")) { throw configurationError( "listen", - "PostgreSQL notification topics must be non-empty and contain no NUL byte" + "Postgres notification topics must be non-empty and contain no NUL byte" ); } if (Buffer.byteLength(channel, "utf8") > POSTGRES_IDENTIFIER_MAX_BYTES) { throw configurationError( "listen", - `PostgreSQL notification channel must not exceed ${POSTGRES_IDENTIFIER_MAX_BYTES} bytes` + `Postgres notification channel must not exceed ${POSTGRES_IDENTIFIER_MAX_BYTES} bytes` ); } return channel; @@ -414,7 +414,7 @@ async function pingListener( } catch (cause: unknown) { throw databaseError( "listen", - "PostgreSQL LISTEN connection did not answer a ping", + "Postgres LISTEN connection did not answer a ping", cause ); } finally { diff --git a/js/driver/pg/src/sql/params.ts b/js/driver/pg/src/sql/params.ts index b7706b32c..dd062a486 100644 --- a/js/driver/pg/src/sql/params.ts +++ b/js/driver/pg/src/sql/params.ts @@ -13,7 +13,7 @@ export function instantParameter( : postgresTimestamp(value); } -/** Require a row limit that fits PostgreSQL's `int`. */ +/** Require a row limit that fits Postgres's `int`. */ export function validateLimit( value: number, label = "queue list maximum" diff --git a/js/driver/pg/src/sql/queues.ts b/js/driver/pg/src/sql/queues.ts index e03e96ca8..3d912e3ca 100644 --- a/js/driver/pg/src/sql/queues.ts +++ b/js/driver/pg/src/sql/queues.ts @@ -67,7 +67,7 @@ export async function queueUpsert( if (row === undefined) { throw databaseError( "queueUpsert", - "PostgreSQL returned no row for an upserted queue" + "Postgres returned no row for an upserted queue" ); } return toQueueRow(row); diff --git a/js/driver/pg/src/sql/rows.ts b/js/driver/pg/src/sql/rows.ts index 4fbd77c23..484628a61 100644 --- a/js/driver/pg/src/sql/rows.ts +++ b/js/driver/pg/src/sql/rows.ts @@ -42,7 +42,7 @@ export interface PgInsertRow extends PgJobRow { export interface PgQueueDatabaseRow extends QueryResultRow { created_at: Temporal.Instant; metadata: unknown; - /** `metadata::text`, PostgreSQL's rendering of the stored JSONB. */ + /** `metadata::text`, Postgres's rendering of the stored JSONB. */ metadata_text: string; name: string; paused_at: Temporal.Instant | null; diff --git a/js/driver/pg/src/stress.integration.test.ts b/js/driver/pg/src/stress.integration.test.ts index 2b3f2a917..6e73b8957 100644 --- a/js/driver/pg/src/stress.integration.test.ts +++ b/js/driver/pg/src/stress.integration.test.ts @@ -124,7 +124,7 @@ async function startFleet( }; } -describe("PostgreSQL multi-client stress", () => { +describe("Postgres multi-client stress", () => { let admin: pg.Pool; beforeAll(async () => { diff --git a/js/driver/pg/src/types.ts b/js/driver/pg/src/types.ts index 56798f84d..e3673d45b 100644 --- a/js/driver/pg/src/types.ts +++ b/js/driver/pg/src/types.ts @@ -1,13 +1,13 @@ import type { ClientBase } from "pg"; import type { AttemptError, JobRow, JsonObject } from "riverqueue"; -/** Construction options owned by the PostgreSQL backend. */ +/** Construction options owned by the Postgres backend. */ export interface PgDriverOptions { - /** PostgreSQL schema containing River's tables and functions. */ + /** Postgres schema containing River's tables and functions. */ schema?: string; } -/** Options common to PostgreSQL semantic operations. */ +/** Options common to Postgres semantic operations. */ export interface PgOperationOptions { /** Caller-owned transaction connection used for the entire operation. */ tx?: ClientBase; @@ -93,7 +93,7 @@ export interface PgLeaderTermParams extends PgLeaderElectParams { electedAt: Temporal.Instant; } -/** A PostgreSQL notification emitted through River's namespaced channels. */ +/** A Postgres notification emitted through River's namespaced channels. */ export interface PgNotification { payload: string; topic: string; diff --git a/js/driver/pg/src/yugabyte.integration.test.ts b/js/driver/pg/src/yugabyte.integration.test.ts index ad1edc9c2..064ed6406 100644 --- a/js/driver/pg/src/yugabyte.integration.test.ts +++ b/js/driver/pg/src/yugabyte.integration.test.ts @@ -1,6 +1,6 @@ /** - * PostgreSQL-compatible servers without `xmax` or `LISTEN`/`NOTIFY`, like - * YugabyteDB, simulated on PostgreSQL the way River for Go's tests do. + * Postgres-compatible servers without `xmax` or `LISTEN`/`NOTIFY`, like + * YugabyteDB, simulated on Postgres the way River for Go's tests do. * * A test schema shadows `version()` and `current_setting(text, boolean)` * ahead of `pg_catalog` on the connections' `search_path`, so River detects @@ -27,7 +27,7 @@ const migrationDirectory = fileURLToPath( /** Which server a test schema simulates. */ type Server = - /** PostgreSQL 17, before `RETURNING OLD`. */ + /** Postgres 17, before `RETURNING OLD`. */ | "postgres17" /** YugabyteDB before 2025.2.3, without `yb_enable_listen_notify`. */ | "yugabyte_unavailable" @@ -47,7 +47,7 @@ function listenNotify(server: Server): boolean { return server === "postgres17" || server === "yugabyte_enabled"; } -describe("PostgreSQL servers like YugabyteDB, simulated", () => { +describe("Postgres servers like YugabyteDB, simulated", () => { const cleanups: (() => Promise)[] = []; afterEach(async () => { @@ -167,7 +167,7 @@ describe("PostgreSQL servers like YugabyteDB, simulated", () => { const client = new Client(new PgDriver(pool)); const job = defineJob({ kind: "yugabyte_quiet" }); - // Each of these notifies on PostgreSQL; the shadowed pg_notify raises. + // Each of these notifies on Postgres; the shadowed pg_notify raises. const { job: inserted } = await client.insert(job, {}); await expect(client.jobs.cancel(inserted.id)).resolves.toMatchObject({ state: "cancelled", diff --git a/js/driver/prisma/README.md b/js/driver/prisma/README.md index 1f574eea2..469f124b0 100644 --- a/js/driver/prisma/README.md +++ b/js/driver/prisma/README.md @@ -39,7 +39,7 @@ await prisma.$transaction(async (tx) => { ``` See the [runnable Prisma example](../../examples/prisma) for Prisma's generated -client and PostgreSQL adapter setup. +client and Postgres adapter setup. The Prisma client and transaction remain caller-owned. River neither connects nor disconnects Prisma. Apply River migrations separately with diff --git a/js/driver/prisma/etc/driver-prisma.api.md b/js/driver/prisma/etc/driver-prisma.api.md index 64567e244..144405d82 100644 --- a/js/driver/prisma/etc/driver-prisma.api.md +++ b/js/driver/prisma/etc/driver-prisma.api.md @@ -29,7 +29,7 @@ export interface PrismaClientLike { ```ts /** - * River's insertion adapter for Prisma on PostgreSQL. + * River's insertion adapter for Prisma on Postgres. * * The Prisma client is caller-owned. A caller-owned transaction client may be * supplied as `{ tx }` and is used for the exact operation. Schema selection @@ -53,9 +53,9 @@ export declare class PrismaDriver { ## `PrismaDriverOptions` ```ts -/** PostgreSQL configuration owned by the adapter. */ +/** Postgres configuration owned by the adapter. */ export interface PrismaDriverOptions { - /** PostgreSQL schema containing River's tables and functions. */ + /** Postgres schema containing River's tables and functions. */ schema?: string; /** * Limits for the interactive transaction River opens for an insertion diff --git a/js/driver/prisma/src/driver.test.ts b/js/driver/prisma/src/driver.test.ts index 3039a9265..9a9d70efc 100644 --- a/js/driver/prisma/src/driver.test.ts +++ b/js/driver/prisma/src/driver.test.ts @@ -104,7 +104,7 @@ describe("PrismaDriver", () => { expect(() => void client.jobs).not.toThrow(); }); - it("keeps exact IDs and PostgreSQL timestamp precision", async () => { + it("keeps exact IDs and Postgres timestamp precision", async () => { prisma.rowsToReturn = [fakePrismaRow()]; const result = await driver.jobInsert(fakeInsertParams()); diff --git a/js/driver/prisma/src/driver.ts b/js/driver/prisma/src/driver.ts index d93c8baa2..d2fdd9dc7 100644 --- a/js/driver/prisma/src/driver.ts +++ b/js/driver/prisma/src/driver.ts @@ -50,9 +50,9 @@ export interface PrismaTransactionOptions { timeout?: number; } -/** PostgreSQL configuration owned by the adapter. */ +/** Postgres configuration owned by the adapter. */ export interface PrismaDriverOptions { - /** PostgreSQL schema containing River's tables and functions. */ + /** Postgres schema containing River's tables and functions. */ schema?: string; /** * Limits for the interactive transaction River opens for an insertion @@ -95,7 +95,7 @@ interface PrismaJobRow extends Record { } /** - * River's insertion adapter for Prisma on PostgreSQL. + * River's insertion adapter for Prisma on Postgres. * * The Prisma client is caller-owned. A caller-owned transaction client may be * supplied as `{ tx }` and is used for the exact operation. Schema selection @@ -375,7 +375,7 @@ export class PrismaInserter implements InsertDriver { const queryable = options?.tx ?? this.#prisma; // A server without LISTEN/NOTIFY, like YugabyteDB by default, gets none. if (!(await this.#detect(queryable)).supportsListenNotify) return; - // Counting the notifications' rows makes PostgreSQL send each one while + // Counting the notifications' rows makes Postgres send each one while // returning no `void` column for Prisma to decode. await queryable.$queryRawUnsafe( ` @@ -436,7 +436,7 @@ export class PrismaInserter implements InsertDriver { }[] >(POSTGRES_CAPABILITIES_SQL); if (row === undefined) { - throw new Error("PostgreSQL returned no server capabilities"); + throw new Error("Postgres returned no server capabilities"); } this.#capabilities ??= postgresCapabilitiesFromRow(row); return this.#capabilities; @@ -534,12 +534,12 @@ function utcText(column: string): string { function validateSchema(value: string): void { if (!RIVER_SCHEMA_RE.test(value)) { throw new TypeError( - "PostgreSQL schema must start with a letter or underscore and contain only letters, numbers, and underscores" + "Postgres schema must start with a letter or underscore and contain only letters, numbers, and underscores" ); } if (Buffer.byteLength(value, "utf8") > RIVER_SCHEMA_MAX_BYTES) { throw new TypeError( - `PostgreSQL schema must not exceed ${RIVER_SCHEMA_MAX_BYTES} bytes so River notification topics remain valid` + `Postgres schema must not exceed ${RIVER_SCHEMA_MAX_BYTES} bytes so River notification topics remain valid` ); } } diff --git a/js/driver/prisma/src/prisma.integration.test.ts b/js/driver/prisma/src/prisma.integration.test.ts index 5edb33db9..8445f37a7 100644 --- a/js/driver/prisma/src/prisma.integration.test.ts +++ b/js/driver/prisma/src/prisma.integration.test.ts @@ -1,5 +1,5 @@ // Runs the driver against a real generated Prisma client and Prisma's -// PostgreSQL adapter, rather than the `pg`-backed stand-in the other +// Postgres adapter, rather than the `pg`-backed stand-in the other // integration tests use, so Prisma's own parameter and result handling is // covered. The client is generated into a temporary directory at startup. import { execFile } from "node:child_process"; diff --git a/js/driver/sqlite/src/codecs.ts b/js/driver/sqlite/src/codecs.ts index 64a460fd4..5870ab9b4 100644 --- a/js/driver/sqlite/src/codecs.ts +++ b/js/driver/sqlite/src/codecs.ts @@ -153,8 +153,8 @@ function decodeJsonObject(value: unknown, field: string): SqliteJsonObject { /** * Decode one `river_job` row exactly as leniently as Go's `riversqlite` does. * - * SQLite columns are wider than PostgreSQL's, so another engine may persist - * values River's PostgreSQL schema would reject: `attempt` and `max_attempts` + * SQLite columns are wider than Postgres's, so another engine may persist + * values River's Postgres schema would reject: `attempt` and `max_attempts` * are unbounded integers, and JSON `null` is accepted for `tags`, * `attempted_by`, and `errors` (Go decodes it as an empty list). Negative counts * clamp to zero like Go, and counts beyond `Number.MAX_SAFE_INTEGER` saturate, diff --git a/js/driver/sqlite/src/coordination.test.ts b/js/driver/sqlite/src/coordination.test.ts index 072b0ff4d..ddecd8091 100644 --- a/js/driver/sqlite/src/coordination.test.ts +++ b/js/driver/sqlite/src/coordination.test.ts @@ -388,7 +388,7 @@ describe("SqliteDriver connection coordination", () => { const other = await fileSetup(); await driver.operationScope(undefined, async (tx) => { - // Nothing is locked yet, so these run as they would on PostgreSQL. + // Nothing is locked yet, so these run as they would on Postgres. await driver.jobInsert({ args: {}, kind: "before_first" }); await expect(driver.jobGet(1n)).resolves.not.toBeNull(); await transaction(database, () => undefined); diff --git a/js/driver/sqlite/src/pilot.test.ts b/js/driver/sqlite/src/pilot.test.ts index 0497b89bc..8c685a83c 100644 --- a/js/driver/sqlite/src/pilot.test.ts +++ b/js/driver/sqlite/src/pilot.test.ts @@ -1202,7 +1202,7 @@ describe("SQLite caller transactions", () => { BEGIN SELECT RAISE(ABORT, 'insert failed'); END` ); - // Unlike PostgreSQL, SQLite undoes only the failed statement, so the + // Unlike Postgres, SQLite undoes only the failed statement, so the // caller's transaction keeps River's earlier write and its own work, // and the caller still rolls back on the error. await rolledBack(database, async (tx) => { diff --git a/js/etc/riverqueue.api.md b/js/etc/riverqueue.api.md index 0f0b78f83..d4f3b693e 100644 --- a/js/etc/riverqueue.api.md +++ b/js/etc/riverqueue.api.md @@ -321,7 +321,7 @@ export interface ClientOptions { /** * Disable notification streams and rely on polling alone. Running jobs * then learn of cancellations by polling every `queueControlPollInterval`. - * A client of a PostgreSQL server without `LISTEN`/`NOTIFY`, such as + * A client of a Postgres server without `LISTEN`/`NOTIFY`, such as * YugabyteDB without `yb_enable_listen_notify`, polls this way on its own. */ readonly pollOnly?: boolean; @@ -1791,9 +1791,9 @@ export interface MaintenanceOptions { readonly queueCleanerInterval?: DurationInput; /** Delete queues nothing has reported for this long. */ readonly queueRetention?: DurationInput; - /** Indexes rebuilt by the PostgreSQL reindexer. */ + /** Indexes rebuilt by the Postgres reindexer. */ readonly reindexerIndexNames?: readonly string[]; - /** When the PostgreSQL reindexer runs next after a given instant. */ + /** When the Postgres reindexer runs next after a given instant. */ readonly reindexerSchedule?: ReindexerSchedule; /** Bound on one index rebuild. */ readonly reindexerTimeout?: DurationInput | null; @@ -2335,7 +2335,7 @@ export type RegisteredTransaction = [keyof RiverTransactionRegistry] extends [ ## `REINDEXER_INDEX_NAMES_DEFAULT` ```ts -/** PostgreSQL indexes River rebuilds by default to control table bloat. */ +/** Postgres indexes River rebuilds by default to control table bloat. */ export declare const REINDEXER_INDEX_NAMES_DEFAULT: readonly [ "river_job_args_index", "river_job_kind", diff --git a/js/etc/riverqueue.unstable-driver.api.md b/js/etc/riverqueue.unstable-driver.api.md index 0b7d5ccf9..7ac405a28 100644 --- a/js/etc/riverqueue.unstable-driver.api.md +++ b/js/etc/riverqueue.unstable-driver.api.md @@ -391,7 +391,7 @@ export declare function finishResumable( /** * Narrow protocol implemented by River's producer adapters. * - * This is not the full runtime database engine boundary. PostgreSQL schema and + * This is not the full runtime database engine boundary. Postgres schema and * other backend-specific configuration belong to the adapter constructor. */ export interface InsertDriver< @@ -881,7 +881,7 @@ export interface JobListKeyset { readonly direction: SortDirection; /** * Whether the time field may be null for listed jobs. Nulls then sort - * explicitly last ascending and first descending, PostgreSQL's default, so + * explicitly last ascending and first descending, Postgres's default, so * every backend agrees and cursors can match them. */ readonly nullable: boolean; @@ -1413,7 +1413,7 @@ export interface PilotDatabase { readonly schema: string | null; /** * Run `callback` with a native handle River has borrowed for it, which is - * not in a transaction: a pooled client on PostgreSQL, or River's own + * not in a transaction: a pooled client on Postgres, or River's own * connection on SQLite while River's lock on it is held. Use it for reads * and single autocommit statements. `signal` stops only the wait for the * handle. A transaction the callback leaves open is rolled back, and the @@ -1437,7 +1437,7 @@ export interface PilotDatabase { * in a supplied `tx`, the call rejects. * `callback` runs at most once: it never runs when River can't begin, and * is never run again. On SQLite, River retries beginning while another - * connection holds the write lock; on PostgreSQL, a failure to lease a + * connection holds the write lock; on Postgres, a failure to lease a * connection or begin rejects at once. A failed commit rejects without * claiming whether the database kept the changes. * @@ -1803,7 +1803,7 @@ export interface PilotStuckContext { readonly signal: AbortSignal; /** * The read's timeout in milliseconds, or `null` for none. River's standard - * read also sets it as the statement's timeout on PostgreSQL; a read the + * read also sets it as the statement's timeout on Postgres; a read the * pilot runs itself should do the same. */ readonly timeoutMs: number | null; @@ -1844,7 +1844,7 @@ export declare const POSTGRES_CAPABILITIES_SQL = ## `PostgresCapabilities` ```ts -/** Features detected from a PostgreSQL-compatible server. */ +/** Features detected from a Postgres-compatible server. */ export interface PostgresCapabilities { /** * Whether `pg_notify` delivers notifications to listeners. Without it, @@ -1874,9 +1874,9 @@ export declare function postgresCapabilitiesFromRow(row: { ```ts /** - * Encode an instant as a PostgreSQL `timestamptz` parameter the way Go's pgx - * does: truncated to whole microseconds, PostgreSQL's precision, rather than - * leaving PostgreSQL to round the sub-microsecond digits of its text input. + * Encode an instant as a Postgres `timestamptz` parameter the way Go's pgx + * does: truncated to whole microseconds, Postgres's precision, rather than + * leaving Postgres to round the sub-microsecond digits of its text input. * Truncation is toward the past, like pgx, so every engine stores the same * instant for the same value. */ @@ -2045,7 +2045,7 @@ export interface QueueUpdateParams { ```ts /** - * Quote an identifier for PostgreSQL or SQLite, doubling embedded quotes. + * Quote an identifier for Postgres or SQLite, doubling embedded quotes. * It doesn't check the identifier's length or characters. */ export declare function quoteIdentifier(value: string): string; @@ -2357,7 +2357,7 @@ export type RuntimeLeader = LeaderTerm; ```ts /** * Bounds of one leader-owned maintenance batch. A backend that can cancel - * database work should stop the batch after `timeoutMs`, like PostgreSQL's + * database work should stop the batch after `timeoutMs`, like Postgres's * `statement_timeout`; `signal` aborts at the timeout or when the leadership * term ends. */ @@ -2530,8 +2530,8 @@ export declare function uniqueInsertConflictSql(mode: UniqueInsertMode): string; * - `metadata_nonce`: each proposed row's metadata carries a random nonce * under {@link UNIQUE_INSERT_NONCE_KEY}, and a returned row without the * one its insert wrote already existed. Used where `xmax` is unavailable. - * - `returning_old`: PostgreSQL 18's `OLD` row in `RETURNING`. - * - `xmax`: PostgreSQL's `xmax` system column, nonzero for an updated row. + * - `returning_old`: Postgres 18's `OLD` row in `RETURNING`. + * - `xmax`: Postgres's `xmax` system column, nonzero for an updated row. */ export type UniqueInsertMode = "metadata_nonce" | "returning_old" | "xmax"; ``` diff --git a/js/examples/mixed-language/README.md b/js/examples/mixed-language/README.md index 14975b301..98ef0074c 100644 --- a/js/examples/mixed-language/README.md +++ b/js/examples/mixed-language/README.md @@ -1,6 +1,6 @@ # Mixed-language producer example -This PostgreSQL example inserts a versioned payload under the stable job kind +This Postgres example inserts a versioned payload under the stable job kind `mixed_language.generate_report`, then reads the durable row back without any JavaScript-private metadata. A Go, Rust, or JavaScript worker can register that same kind and decode the same JSON contract. diff --git a/js/examples/node-postgres/README.md b/js/examples/node-postgres/README.md index 689e9a34d..8ea7cc5d1 100644 --- a/js/examples/node-postgres/README.md +++ b/js/examples/node-postgres/README.md @@ -1,16 +1,16 @@ # River TypeScript Example: node-postgres -A minimal example demonstrating how to use the [River](https://github.com/riverqueue/river/tree/master/js) TypeScript client with `node-postgres` (`pg`) to insert background jobs into PostgreSQL. +A minimal example demonstrating how to use the [River](https://github.com/riverqueue/river/tree/master/js) TypeScript client with `node-postgres` (`pg`) to insert background jobs into Postgres. The example defines typed jobs and shows single insertion, scheduling, batch -insertion, and an explicit caller-owned PostgreSQL transaction that commits an +insertion, and an explicit caller-owned Postgres transaction that commits an application row and its River job atomically. ## Prerequisites - Node.js >= 26 - pnpm -- PostgreSQL with [River's schema](https://riverqueue.com/docs) migrated +- Postgres with [River's schema](https://riverqueue.com/docs) migrated ## Setup diff --git a/js/examples/pg-worker/README.md b/js/examples/pg-worker/README.md index 40bf45f07..4e4f1e4ba 100644 --- a/js/examples/pg-worker/README.md +++ b/js/examples/pg-worker/README.md @@ -1,6 +1,6 @@ -# PostgreSQL worker example +# Postgres worker example -This example migrates a PostgreSQL database, inserts a job, and works it in +This example migrates a Postgres database, inserts a job, and works it in the same process: the handler snoozes once as if a payment provider were busy, then succeeds and inserts a follow-up job through the worker's own client. It shuts down gracefully when the follow-up completes or on `SIGTERM`. @@ -9,7 +9,7 @@ It uses `node-postgres`, Zod for validation, and structured logging through the job's `logger` (which writes warnings and errors to `console` unless the client is given a logger such as pino). -From the repository root, with a disposable PostgreSQL database: +From the repository root, with a disposable Postgres database: ```sh pnpm install diff --git a/js/examples/prisma/README.md b/js/examples/prisma/README.md index 08e19fa5e..9d31fe165 100644 --- a/js/examples/prisma/README.md +++ b/js/examples/prisma/README.md @@ -1,6 +1,6 @@ # River TypeScript Example: Prisma -A minimal example demonstrating how to use the [River](https://github.com/riverqueue/river/tree/master/js) TypeScript client with [Prisma](https://www.prisma.io/) to insert background jobs into PostgreSQL. +A minimal example demonstrating how to use the [River](https://github.com/riverqueue/river/tree/master/js) TypeScript client with [Prisma](https://www.prisma.io/) to insert background jobs into Postgres. The example defines typed jobs and shows single insertion, scheduling, batch insertion, and a caller-owned Prisma interactive transaction that commits an @@ -10,7 +10,7 @@ application row and its River job atomically. - Node.js >= 26 - pnpm -- PostgreSQL with [River's schema](https://riverqueue.com/docs) migrated +- Postgres with [River's schema](https://riverqueue.com/docs) migrated ## Setup diff --git a/js/migrate/README.md b/js/migrate/README.md index ee3ffc14e..25a3ae3f0 100644 --- a/js/migrate/README.md +++ b/js/migrate/README.md @@ -1,6 +1,6 @@ # `@riverqueue/migrate` -River's PostgreSQL and SQLite migrations, with a runner that applies them. +River's Postgres and SQLite migrations, with a runner that applies them. Requires Node.js 26 or newer. River never migrates on its own: clients don't touch the schema when they are @@ -8,7 +8,7 @@ constructed or started. Run migrations as a deployment step, either with this package or with the `riverqueue` command from `@riverqueue/cli`, and keep `@riverqueue/migrate` on the same version as `riverqueue`. -## PostgreSQL +## Postgres Pass the driver your client uses, so the pool and schema are configured once: @@ -52,7 +52,7 @@ statements. With `{ database }`, migrations run directly on that handle, which waits for a busy database for its own `timeout`. Version 8 rebuilds SQLite's `river_job` table with an `AUTOINCREMENT` key, so -a deleted job's ID is never handed to a new job; on PostgreSQL it changes +a deleted job's ID is never handed to a new job; on Postgres it changes nothing. Like River for Go's migration, it refuses to run in either direction while the database holds a `river_job_sequence`, `river_job_workflow_scheduling`, or `river_workflow` object, which extensions install alongside River's tables diff --git a/js/migrate/etc/migrate.api.md b/js/migrate/etc/migrate.api.md index 58535d1b9..cc56ac21e 100644 --- a/js/migrate/etc/migrate.api.md +++ b/js/migrate/etc/migrate.api.md @@ -41,7 +41,7 @@ export declare function createMigrator( * Load River's bundled main migration line for a backend, ordered by version. * * The SQL files ship with this package and are verified against recorded - * checksums on every load. PostgreSQL SQL contains a schema placeholder that + * checksums on every load. Postgres SQL contains a schema placeholder that * a migrator fills in, so run migrations through {@link createMigrator} * instead of executing this SQL directly. * @@ -173,7 +173,7 @@ export type MigrationTarget = * * Create one with {@link createMigrator}. Each version runs in its own * transaction together with its `river_migration` bookkeeping. Concurrent - * migrators for the same schema serialize: PostgreSQL uses a + * migrators for the same schema serialize: Postgres uses a * transaction-scoped advisory lock and SQLite uses an immediate write * transaction, and a version finished by another migrator is skipped rather * than run twice. @@ -242,7 +242,7 @@ export type MigratorSource = ClientDriver | MigrationTarget; ## `PgClientMigrationTarget` ```ts -/** Migrate PostgreSQL through one dedicated connection. */ +/** Migrate Postgres through one dedicated connection. */ export interface PgClientMigrationTarget { /** * A connected node-postgres `Client` or `PoolClient` that is not inside a @@ -261,7 +261,7 @@ export interface PgClientMigrationTarget { ```ts /** - * A PostgreSQL connection that can run River's migrations, such as a + * A Postgres connection that can run River's migrations, such as a * node-postgres `Client` or a `PoolClient` checked out of a pool. * * The connection must not be inside a transaction: every migration version @@ -279,7 +279,7 @@ export interface PgMigrationClient { ## `PgMigrationPool` ```ts -/** A PostgreSQL connection pool such as a node-postgres `Pool`. */ +/** A Postgres connection pool such as a node-postgres `Pool`. */ export interface PgMigrationPool { /** Check out a dedicated connection for migrating. */ connect(): Promise; @@ -304,7 +304,7 @@ export interface PgMigrationPoolClient extends PgMigrationClient { ## `PgMigrationQueryResult` ```ts -/** Result shape that River reads from PostgreSQL queries. */ +/** Result shape that River reads from Postgres queries. */ export interface PgMigrationQueryResult { rows: TRow[]; } @@ -313,7 +313,7 @@ export interface PgMigrationQueryResult { ## `PgPoolMigrationTarget` ```ts -/** Migrate PostgreSQL through a connection pool. */ +/** Migrate Postgres through a connection pool. */ export interface PgPoolMigrationTarget { /** * A node-postgres `Pool`. The migrator checks out one connection per call diff --git a/js/migrate/migrations/manifest.json b/js/migrate/migrations/manifest.json index 02ce02607..ef9f6f0af 100644 --- a/js/migrate/migrations/manifest.json +++ b/js/migrate/migrations/manifest.json @@ -51,19 +51,19 @@ }, { "file": "007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql", - "sha256": "9131aae235187dbdaaa822dab2a475a884e917d9af05e3c98fb95c152eaa769a" + "sha256": "2771765becc5baa0a8af4406cb4d58ea6d3fb0ebdbf72a0c23ccc72da623caeb" }, { "file": "007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql", - "sha256": "47ec8031b88e69004de2def5bc3109d969f71ee4c33a1e7dac2fb8c9dd19182d" + "sha256": "af01339fcb1687de1f768a570b6ad1e51d23300082aed60440f6a662a0e39d85" }, { "file": "008_job_id_autoincrement.down.sql", - "sha256": "0c3750a947d6494db07d56f5d3735a5e49a2cbfa1f7a09771227c31c8147bf70" + "sha256": "678b3b02deb2f798c3fda3a73c974fc1fe48c6b88688b94f0f7700132b30626f" }, { "file": "008_job_id_autoincrement.up.sql", - "sha256": "0c3750a947d6494db07d56f5d3735a5e49a2cbfa1f7a09771227c31c8147bf70" + "sha256": "678b3b02deb2f798c3fda3a73c974fc1fe48c6b88688b94f0f7700132b30626f" } ], "sqlite": [ @@ -129,7 +129,7 @@ }, { "file": "008_job_id_autoincrement.up.sql", - "sha256": "049c9bf615f24a326bcc31ddc87b46f76e3de11e3eea3b2b9e1358131b3f3bed" + "sha256": "3ce6d941f4c434adbd87e69089fa5e99b6047e5b51e611c9845e1d0d3c080e0f" } ] }, diff --git a/js/migrate/migrations/postgres/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql b/js/migrate/migrations/postgres/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql index bed717f87..9dd01264c 100644 --- a/js/migrate/migrations/postgres/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql +++ b/js/migrate/migrations/postgres/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql @@ -47,7 +47,7 @@ ALTER TABLE /* TEMPLATE: schema */river_queue -- -- SQLite JSONB conversion rollback. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- Notification outbox rollback. diff --git a/js/migrate/migrations/postgres/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql b/js/migrate/migrations/postgres/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql index 39e3249c9..41fabc912 100644 --- a/js/migrate/migrations/postgres/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql +++ b/js/migrate/migrations/postgres/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql @@ -16,7 +16,7 @@ CREATE INDEX river_notification_topic_id_idx ON /* TEMPLATE: schema */river_noti -- -- SQLite JSONB conversion. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- SQL cleanup. diff --git a/js/migrate/migrations/postgres/main/008_job_id_autoincrement.down.sql b/js/migrate/migrations/postgres/main/008_job_id_autoincrement.down.sql index 695357bb8..0bad60286 100644 --- a/js/migrate/migrations/postgres/main/008_job_id_autoincrement.down.sql +++ b/js/migrate/migrations/postgres/main/008_job_id_autoincrement.down.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/js/migrate/migrations/postgres/main/008_job_id_autoincrement.up.sql b/js/migrate/migrations/postgres/main/008_job_id_autoincrement.up.sql index 695357bb8..0bad60286 100644 --- a/js/migrate/migrations/postgres/main/008_job_id_autoincrement.up.sql +++ b/js/migrate/migrations/postgres/main/008_job_id_autoincrement.up.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/js/migrate/migrations/sqlite/main/008_job_id_autoincrement.up.sql b/js/migrate/migrations/sqlite/main/008_job_id_autoincrement.up.sql index c7de15deb..6ee4b32c7 100644 --- a/js/migrate/migrations/sqlite/main/008_job_id_autoincrement.up.sql +++ b/js/migrate/migrations/sqlite/main/008_job_id_autoincrement.up.sql @@ -1,5 +1,5 @@ -- Rebuild river_job so automatically generated IDs are never reused after the --- job holding the largest ID is deleted. Unlike PostgreSQL sequences, SQLite's +-- job holding the largest ID is deleted. Unlike Postgres sequences, SQLite's -- default ROWID allocator may otherwise reuse that deleted ID. -- Rebuilding river_job would discard schema installed by River Pro. Check diff --git a/js/migrate/src/bundle.ts b/js/migrate/src/bundle.ts index 3e79ed0ad..11c2f1e43 100644 --- a/js/migrate/src/bundle.ts +++ b/js/migrate/src/bundle.ts @@ -33,7 +33,7 @@ const MIGRATION_FILE_RE = * Load River's bundled main migration line for a backend, ordered by version. * * The SQL files ship with this package and are verified against recorded - * checksums on every load. PostgreSQL SQL contains a schema placeholder that + * checksums on every load. Postgres SQL contains a schema placeholder that * a migrator fills in, so run migrations through {@link createMigrator} * instead of executing this SQL directly. * diff --git a/js/migrate/src/index.ts b/js/migrate/src/index.ts index ed3b39d8b..a27bd2e70 100644 --- a/js/migrate/src/index.ts +++ b/js/migrate/src/index.ts @@ -1,5 +1,5 @@ /** - * River's database migrations for PostgreSQL and SQLite, and a runner that + * River's database migrations for Postgres and SQLite, and a runner that * applies them explicitly during deployment. * * @packageDocumentation diff --git a/js/migrate/src/migrator.integration.test.ts b/js/migrate/src/migrator.integration.test.ts index 2745c1023..1f92acf01 100644 --- a/js/migrate/src/migrator.integration.test.ts +++ b/js/migrate/src/migrator.integration.test.ts @@ -22,7 +22,7 @@ function quote(identifier: string): string { return `"${identifier.replaceAll('"', '""')}"`; } -describe("PostgreSQL migrator", () => { +describe("Postgres migrator", () => { let pool: pg.Pool; let schema: string; let schemas: string[]; diff --git a/js/migrate/src/migrator.test.ts b/js/migrate/src/migrator.test.ts index b6da00082..39075c2cf 100644 --- a/js/migrate/src/migrator.test.ts +++ b/js/migrate/src/migrator.test.ts @@ -110,7 +110,7 @@ describe("createMigrator", () => { expect(() => createMigrator(source as never)).toThrow(message); }); - it("rejects invalid PostgreSQL schemas", () => { + it("rejects invalid Postgres schemas", () => { const pool = {} as PgMigrationPool; expect(() => createMigrator({ pool, schema: "" })).toThrow("non-empty"); @@ -152,7 +152,7 @@ describe("createMigrator", () => { }); }); -describe("PostgreSQL migrator", () => { +describe("Postgres migrator", () => { it("renders a quoted custom schema for a dry run without connecting", async () => { const queries: { text: string; values?: readonly unknown[] }[] = []; const pool: PgMigrationPool = { @@ -187,7 +187,7 @@ describe("PostgreSQL migrator", () => { }); for (const [server, product, locks] of [ - ["PostgreSQL", "PostgreSQL 17.4 on aarch64-apple-darwin", true], + ["Postgres", "PostgreSQL 17.4 on aarch64-apple-darwin", true], [ "YugabyteDB", "PostgreSQL 15.12-YB-2025.2.1.0-b1 on x86_64-pc-linux-gnu", diff --git a/js/migrate/src/migrator.ts b/js/migrate/src/migrator.ts index a12c27641..a15397064 100644 --- a/js/migrate/src/migrator.ts +++ b/js/migrate/src/migrator.ts @@ -77,7 +77,7 @@ export interface MigrateVersion { * * Create one with {@link createMigrator}. Each version runs in its own * transaction together with its `river_migration` bookkeeping. Concurrent - * migrators for the same schema serialize: PostgreSQL uses a + * migrators for the same schema serialize: Postgres uses a * transaction-scoped advisory lock and SQLite uses an immediate write * transaction, and a version finished by another migrator is skipped rather * than run twice. @@ -139,7 +139,7 @@ export type MigratorSource = ClientDriver | MigrationTarget; export type MigrationTarget = PgClientMigrationTarget | PgPoolMigrationTarget | SqliteMigrationTarget; -/** Migrate PostgreSQL through one dedicated connection. */ +/** Migrate Postgres through one dedicated connection. */ export interface PgClientMigrationTarget { /** * A connected node-postgres `Client` or `PoolClient` that is not inside a @@ -153,7 +153,7 @@ export interface PgClientMigrationTarget { readonly schema?: string | undefined; } -/** Migrate PostgreSQL through a connection pool. */ +/** Migrate Postgres through a connection pool. */ export interface PgPoolMigrationTarget { /** * A node-postgres `Pool`. The migrator checks out one connection per call diff --git a/js/migrate/src/postgres.ts b/js/migrate/src/postgres.ts index b12597275..951254aa3 100644 --- a/js/migrate/src/postgres.ts +++ b/js/migrate/src/postgres.ts @@ -15,13 +15,13 @@ import type { MigrationStorage, } from "./storage.js"; -/** Result shape that River reads from PostgreSQL queries. */ +/** Result shape that River reads from Postgres queries. */ export interface PgMigrationQueryResult { rows: TRow[]; } /** - * A PostgreSQL connection that can run River's migrations, such as a + * A Postgres connection that can run River's migrations, such as a * node-postgres `Client` or a `PoolClient` checked out of a pool. * * The connection must not be inside a transaction: every migration version @@ -41,7 +41,7 @@ export interface PgMigrationPoolClient extends PgMigrationClient { release(error?: Error): void; } -/** A PostgreSQL connection pool such as a node-postgres `Pool`. */ +/** A Postgres connection pool such as a node-postgres `Pool`. */ export interface PgMigrationPool { /** Check out a dedicated connection for migrating. */ connect(): Promise; @@ -56,7 +56,7 @@ const POSTGRES_IDENTIFIER_MAX_BYTES = 63; const TEMPLATE_SCHEMA = "/* TEMPLATE: schema */"; // Transaction-scoped so that it is released on commit or rollback and works -// through transaction-pooling proxies. The key uses the schema PostgreSQL +// through transaction-pooling proxies. The key uses the schema Postgres // resolves rather than how the caller spelled it, so an omitted schema and // its explicit name serialize against each other. const LOCK_SQL = @@ -117,7 +117,7 @@ export class PgMigrationStorage implements MigrationStorage { try { client = await connection.pool.connect(); } catch (error: unknown) { - throw new MigrationError("failed to connect to PostgreSQL", { + throw new MigrationError("failed to connect to Postgres", { backend: "postgres", operation: "connect", cause: error, @@ -259,7 +259,7 @@ export class PgMigrationStorage implements MigrationStorage { } } -/** Throw unless `value` can name a PostgreSQL schema. */ +/** Throw unless `value` can name a Postgres schema. */ function validateSchema(value: string): void { const fail = (message: string): never => { throw new MigrationError(message, { @@ -268,14 +268,14 @@ function validateSchema(value: string): void { }); }; if (typeof value !== "string" || value.length === 0) { - fail("PostgreSQL schema must be a non-empty string"); + fail("Postgres schema must be a non-empty string"); } if (value.includes("\0")) { - fail("PostgreSQL schema must not contain a NUL byte"); + fail("Postgres schema must not contain a NUL byte"); } if (Buffer.byteLength(value, "utf8") > POSTGRES_IDENTIFIER_MAX_BYTES) { fail( - `PostgreSQL schema must not exceed ${POSTGRES_IDENTIFIER_MAX_BYTES} bytes` + `Postgres schema must not exceed ${POSTGRES_IDENTIFIER_MAX_BYTES} bytes` ); } } diff --git a/js/migrate/src/sqlite.ts b/js/migrate/src/sqlite.ts index b54253359..9d1b5ca2b 100644 --- a/js/migrate/src/sqlite.ts +++ b/js/migrate/src/sqlite.ts @@ -16,7 +16,7 @@ import type { } from "./storage.js"; // Reverting main version 5 rebuilds `river_migration` without its `line` -// column, which would lose other lines' history. PostgreSQL's SQL refuses +// column, which would lose other lines' history. Postgres's SQL refuses // this itself; SQLite cannot raise from plain SQL, so the migrator checks. const LINE_COLUMN_VERSION = 5; const TEMPLATE_SCHEMA = "/* TEMPLATE: schema */"; @@ -51,7 +51,7 @@ export class SqliteMigrationStorage implements MigrationStorage { } renderSql(sql: string): string { - // SQLite has no schemas, so the placeholder shared with PostgreSQL's SQL + // SQLite has no schemas, so the placeholder shared with Postgres's SQL // renders as nothing. return sql.replaceAll(TEMPLATE_SCHEMA, ""); } diff --git a/js/migrate/src/storage.ts b/js/migrate/src/storage.ts index c14304ff2..112aa114f 100644 --- a/js/migrate/src/storage.ts +++ b/js/migrate/src/storage.ts @@ -26,7 +26,7 @@ export interface MigrationStorage { readonly backend: MigrationBackend; /** Read the applied versions of `line` without holding a connection. */ readVersions(line: string): Promise; - /** Fill in placeholders such as the PostgreSQL schema. */ + /** Fill in placeholders such as the Postgres schema. */ renderSql(sql: string): string; /** Run `run` with a session bound to one connection. */ withSession(run: (session: MigrationSession) => Promise): Promise; diff --git a/js/scripts/check-packages.mjs b/js/scripts/check-packages.mjs index d5ca5f33e..f2ff305b2 100644 --- a/js/scripts/check-packages.mjs +++ b/js/scripts/check-packages.mjs @@ -497,7 +497,7 @@ if (!completed) throw new Error("packed SQLite worker did not complete its job") // Exercise real behavior through the installed tarballs with Node's own // test runner, so no transpiler or workspace alias can hide a packaging - // failure. The PostgreSQL tests run only when DATABASE_URL is set. + // failure. The Postgres tests run only when DATABASE_URL is set. await cp( resolve(repositoryRoot, "scripts", "packed-tests"), join(consumerDirectory, "packed-tests"), diff --git a/js/scripts/packed-tests/postgres.test.mjs b/js/scripts/packed-tests/postgres.test.mjs index 6417297e7..2a6f14db5 100644 --- a/js/scripts/packed-tests/postgres.test.mjs +++ b/js/scripts/packed-tests/postgres.test.mjs @@ -28,7 +28,7 @@ const accountJob = defineJob({ }); describe( - "packed PostgreSQL driver", + "packed Postgres driver", { skip: DATABASE_URL === "" && "set DATABASE_URL to run" }, () => { // Everything happens in a throwaway schema, so a shared database is safe. diff --git a/js/scripts/sync-migrations.mjs b/js/scripts/sync-migrations.mjs index 7ebf845f8..2373b05f1 100644 --- a/js/scripts/sync-migrations.mjs +++ b/js/scripts/sync-migrations.mjs @@ -1,4 +1,4 @@ -// Mirrors River's canonical PostgreSQL and SQLite migrations, which live in +// Mirrors River's canonical Postgres and SQLite migrations, which live in // the Go drivers of the River repository this workspace is part of, into // `migrate/migrations` with a manifest of SHA-256 digests. `--check` fails // instead of writing when the mirror or its manifest differs from River's diff --git a/js/src/client.ts b/js/src/client.ts index 39a08cc08..4c0a482d7 100644 --- a/js/src/client.ts +++ b/js/src/client.ts @@ -1494,7 +1494,7 @@ function validateJobId(id: bigint): bigint { /** * Reject a batch in which a unique key appears more than once among the jobs * whose state it covers, before anything is written. River for Go writes a - * batch in one statement, which PostgreSQL refuses when two rows claim the + * batch in one statement, which Postgres refuses when two rows claim the * same key, and checks SQLite batches the same way. */ function rejectRepeatedUniqueKeys(params: readonly JobInsertParams[]): void { diff --git a/js/src/driver.ts b/js/src/driver.ts index 6f3a71527..2618bf2ef 100644 --- a/js/src/driver.ts +++ b/js/src/driver.ts @@ -55,7 +55,7 @@ export interface JobListKeyset { readonly direction: SortDirection; /** * Whether the time field may be null for listed jobs. Nulls then sort - * explicitly last ascending and first descending, PostgreSQL's default, so + * explicitly last ascending and first descending, Postgres's default, so * every backend agrees and cursors can match them. */ readonly nullable: boolean; @@ -224,7 +224,7 @@ export interface RuntimeJobCleanupParams { /** * Bounds of one leader-owned maintenance batch. A backend that can cancel - * database work should stop the batch after `timeoutMs`, like PostgreSQL's + * database work should stop the batch after `timeoutMs`, like Postgres's * `statement_timeout`; `signal` aborts at the timeout or when the leadership * term ends. */ @@ -402,7 +402,7 @@ export type RegisteredTransaction = [keyof RiverTransactionRegistry] extends [ /** * Narrow protocol implemented by River's producer adapters. * - * This is not the full runtime database engine boundary. PostgreSQL schema and + * This is not the full runtime database engine boundary. Postgres schema and * other backend-specific configuration belong to the adapter constructor. */ export interface InsertDriver< diff --git a/js/src/internal/maintenance-batch.ts b/js/src/internal/maintenance-batch.ts index 92fdc7745..0dfdf7d81 100644 --- a/js/src/internal/maintenance-batch.ts +++ b/js/src/internal/maintenance-batch.ts @@ -112,7 +112,7 @@ export interface MaintenanceBatcherOptions { * batch by its timeout, and trips the service's reduced batch size breaker * when a batch times out. * - * A batch times out when it's still running at its deadline. PostgreSQL + * A batch times out when it's still running at its deadline. Postgres * enforces the timeout on the server, so the batch fails and rolls back like * Go's. SQLite statements can't be interrupted, so a SQLite batch that * overruns keeps its work; it still counts as a timeout for the breaker. diff --git a/js/src/internal/postgres-capabilities.ts b/js/src/internal/postgres-capabilities.ts index 6ce128e93..8c6502e86 100644 --- a/js/src/internal/postgres-capabilities.ts +++ b/js/src/internal/postgres-capabilities.ts @@ -1,9 +1,9 @@ /** - * Features of a PostgreSQL-compatible server that River adapts to, like + * Features of a Postgres-compatible server that River adapts to, like * River for Go's `riverdriver.PostgresCapabilities`. * - * YugabyteDB speaks PostgreSQL's protocol but has no `xmax` system column - * and, unless configured for it, no `LISTEN`/`NOTIFY`. River's PostgreSQL + * YugabyteDB speaks Postgres's protocol but has no `xmax` system column + * and, unless configured for it, no `LISTEN`/`NOTIFY`. River's Postgres * drivers detect the server once and cache the result for the driver's * lifetime, so enabling Yugabyte's notifications takes effect only for a new * driver, such as after a restart. @@ -31,12 +31,12 @@ export const POSTGRES_CAPABILITIES_SQL = ` * - `metadata_nonce`: each proposed row's metadata carries a random nonce * under {@link UNIQUE_INSERT_NONCE_KEY}, and a returned row without the * one its insert wrote already existed. Used where `xmax` is unavailable. - * - `returning_old`: PostgreSQL 18's `OLD` row in `RETURNING`. - * - `xmax`: PostgreSQL's `xmax` system column, nonzero for an updated row. + * - `returning_old`: Postgres 18's `OLD` row in `RETURNING`. + * - `xmax`: Postgres's `xmax` system column, nonzero for an updated row. */ export type UniqueInsertMode = "metadata_nonce" | "returning_old" | "xmax"; -/** Features detected from a PostgreSQL-compatible server. */ +/** Features detected from a Postgres-compatible server. */ export interface PostgresCapabilities { /** * Whether `pg_notify` delivers notifications to listeners. Without it, @@ -89,7 +89,7 @@ export function postgresCapabilitiesFromRow(row: { !Number.isSafeInteger(versionNum) || typeof row.yb_listen_notify_enabled !== "boolean" ) { - throw new TypeError("unexpected PostgreSQL server capabilities row"); + throw new TypeError("unexpected Postgres server capabilities row"); } return postgresCapabilities( row.product, diff --git a/js/src/internal/sql.ts b/js/src/internal/sql.ts index 05e3f48a4..72314b838 100644 --- a/js/src/internal/sql.ts +++ b/js/src/internal/sql.ts @@ -1,5 +1,5 @@ /** - * Quote an identifier for PostgreSQL or SQLite, doubling embedded quotes. + * Quote an identifier for Postgres or SQLite, doubling embedded quotes. * It doesn't check the identifier's length or characters. */ export function quoteIdentifier(value: string): string { diff --git a/js/src/internal/timestamp.ts b/js/src/internal/timestamp.ts index e9ef7cad3..39339823f 100644 --- a/js/src/internal/timestamp.ts +++ b/js/src/internal/timestamp.ts @@ -1,7 +1,7 @@ /** - * Encode an instant as a PostgreSQL `timestamptz` parameter the way Go's pgx - * does: truncated to whole microseconds, PostgreSQL's precision, rather than - * leaving PostgreSQL to round the sub-microsecond digits of its text input. + * Encode an instant as a Postgres `timestamptz` parameter the way Go's pgx + * does: truncated to whole microseconds, Postgres's precision, rather than + * leaving Postgres to round the sub-microsecond digits of its text input. * Truncation is toward the past, like pgx, so every engine stores the same * instant for the same value. */ diff --git a/js/src/options.ts b/js/src/options.ts index f85380337..f79ef808b 100644 --- a/js/src/options.ts +++ b/js/src/options.ts @@ -106,9 +106,9 @@ export interface MaintenanceOptions { readonly queueCleanerInterval?: DurationInput; /** Delete queues nothing has reported for this long. */ readonly queueRetention?: DurationInput; - /** Indexes rebuilt by the PostgreSQL reindexer. */ + /** Indexes rebuilt by the Postgres reindexer. */ readonly reindexerIndexNames?: readonly string[]; - /** When the PostgreSQL reindexer runs next after a given instant. */ + /** When the Postgres reindexer runs next after a given instant. */ readonly reindexerSchedule?: ReindexerSchedule; /** Bound on one index rebuild. */ readonly reindexerTimeout?: DurationInput | null; @@ -223,7 +223,7 @@ export interface ClientOptions { /** * Disable notification streams and rely on polling alone. Running jobs * then learn of cancellations by polling every `queueControlPollInterval`. - * A client of a PostgreSQL server without `LISTEN`/`NOTIFY`, such as + * A client of a Postgres server without `LISTEN`/`NOTIFY`, such as * YugabyteDB without `yb_enable_listen_notify`, polls this way on its own. */ readonly pollOnly?: boolean; diff --git a/js/src/pilot.ts b/js/src/pilot.ts index 97d7af967..bdfc35d5f 100644 --- a/js/src/pilot.ts +++ b/js/src/pilot.ts @@ -65,7 +65,7 @@ export interface PilotDatabase { /** * Run `callback` with a native handle River has borrowed for it, which is - * not in a transaction: a pooled client on PostgreSQL, or River's own + * not in a transaction: a pooled client on Postgres, or River's own * connection on SQLite while River's lock on it is held. Use it for reads * and single autocommit statements. `signal` stops only the wait for the * handle. A transaction the callback leaves open is rolled back, and the @@ -88,7 +88,7 @@ export interface PilotDatabase { * in a supplied `tx`, the call rejects. * `callback` runs at most once: it never runs when River can't begin, and * is never run again. On SQLite, River retries beginning while another - * connection holds the write lock; on PostgreSQL, a failure to lease a + * connection holds the write lock; on Postgres, a failure to lease a * connection or begin rejects at once. A failed commit rejects without * claiming whether the database kept the changes. * @@ -214,7 +214,7 @@ export interface PilotStuckContext { readonly signal: AbortSignal; /** * The read's timeout in milliseconds, or `null` for none. River's standard - * read also sets it as the statement's timeout on PostgreSQL; a read the + * read also sets it as the statement's timeout on Postgres; a read the * pilot runs itself should do the same. */ readonly timeoutMs: number | null; diff --git a/js/src/runtime.ts b/js/src/runtime.ts index b779213af..1be2c83ad 100644 --- a/js/src/runtime.ts +++ b/js/src/runtime.ts @@ -714,7 +714,7 @@ export class RuntimeController { /** * Whether this runtime hears notifications: it isn't poll-only, its driver - * can subscribe, and the database delivers them, which a PostgreSQL + * can subscribe, and the database delivers them, which a Postgres * driver detects from the server. */ async #listens(): Promise { diff --git a/js/src/runtime/failures.ts b/js/src/runtime/failures.ts index 5da57c21a..f25d1dca0 100644 --- a/js/src/runtime/failures.ts +++ b/js/src/runtime/failures.ts @@ -77,7 +77,7 @@ export function isPermanentRuntimeError(error: unknown): boolean { /** * One-line operator description of an error and its `cause` chain, including - * backend codes such as a PostgreSQL SQLSTATE, for background-failure logs. + * backend codes such as a Postgres SQLSTATE, for background-failure logs. */ export function describeError(error: unknown): string { const parts: string[] = []; diff --git a/js/src/services.test.ts b/js/src/services.test.ts index fcd4a2448..5a85bd7f2 100644 --- a/js/src/services.test.ts +++ b/js/src/services.test.ts @@ -621,7 +621,7 @@ describe("RuntimeServices", () => { let failing = true; const timedOutBatch = (batch: RuntimeMaintenanceBatch | undefined) => { expect(batch?.timeoutMs).toBe(5); - // Like PostgreSQL's statement_timeout, the backend stops the batch at + // Like Postgres's statement_timeout, the backend stops the batch at // its timeout. return new Promise((resolve, reject) => { if (!failing) { diff --git a/js/src/services.ts b/js/src/services.ts index aa0c32df7..2fd51ebfe 100644 --- a/js/src/services.ts +++ b/js/src/services.ts @@ -62,7 +62,7 @@ const MAINTENANCE_START_BACKOFF: BackoffPolicy = Object.freeze({ const RESCUE_DECISION_CONCURRENCY = 32; const SCHEDULER_NOTIFICATION_LOOKAHEAD_MS = 5; -/** PostgreSQL indexes River rebuilds by default to control table bloat. */ +/** Postgres indexes River rebuilds by default to control table bloat. */ export const REINDEXER_INDEX_NAMES_DEFAULT = Object.freeze([ "river_job_args_index", "river_job_kind", diff --git a/js/vitest.integration.config.ts b/js/vitest.integration.config.ts index 1b4c8dd27..899201a87 100644 --- a/js/vitest.integration.config.ts +++ b/js/vitest.integration.config.ts @@ -22,7 +22,7 @@ export default defineConfig({ ], }, test: { - // Every PostgreSQL integration fixture owns the canonical River tables. + // Every Postgres integration fixture owns the canonical River tables. // Keep files sequential so one fixture cannot truncate another's rows. fileParallelism: false, include: ["**/*.integration.test.ts"], diff --git a/riverdriver/postgres_capabilities.go b/riverdriver/postgres_capabilities.go index f22ad5be3..f6f84f013 100644 --- a/riverdriver/postgres_capabilities.go +++ b/riverdriver/postgres_capabilities.go @@ -2,7 +2,7 @@ package riverdriver import "strings" -// PostgresCapabilities describes database features detected by PostgreSQL drivers. +// PostgresCapabilities describes database features detected by Postgres drivers. // Drivers cache a successful detection for their lifetime. type PostgresCapabilities struct { SupportsListenNotify bool diff --git a/riverdriver/river_driver_interface.go b/riverdriver/river_driver_interface.go index dde894b89..f76adc29b 100644 --- a/riverdriver/river_driver_interface.go +++ b/riverdriver/river_driver_interface.go @@ -130,7 +130,7 @@ type Driver[TTx any] interface { // SQLFragmentColumnContainsAll generates an SQL fragment to be included as // a predicate in a `WHERE` query for a collection column containing all of - // the given values. PostgreSQL uses array containment while SQLite compares + // the given values. Postgres uses array containment while SQLite compares // values from a JSON array. // // API is not stable. DO NOT USE. @@ -138,7 +138,7 @@ type Driver[TTx any] interface { // SQLFragmentColumnContainsAny generates an SQL fragment to be included as // a predicate in a `WHERE` query for a collection column containing at least - // one of the given values. PostgreSQL uses array overlap while SQLite + // one of the given values. Postgres uses array overlap while SQLite // compares values from a JSON array. // // API is not stable. DO NOT USE. diff --git a/riverdriver/riverdatabasesql/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql b/riverdriver/riverdatabasesql/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql index bed717f87..9dd01264c 100644 --- a/riverdriver/riverdatabasesql/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql +++ b/riverdriver/riverdatabasesql/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql @@ -47,7 +47,7 @@ ALTER TABLE /* TEMPLATE: schema */river_queue -- -- SQLite JSONB conversion rollback. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- Notification outbox rollback. diff --git a/riverdriver/riverdatabasesql/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql b/riverdriver/riverdatabasesql/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql index 39e3249c9..41fabc912 100644 --- a/riverdriver/riverdatabasesql/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql +++ b/riverdriver/riverdatabasesql/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql @@ -16,7 +16,7 @@ CREATE INDEX river_notification_topic_id_idx ON /* TEMPLATE: schema */river_noti -- -- SQLite JSONB conversion. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- SQL cleanup. diff --git a/riverdriver/riverdatabasesql/migration/main/008_job_id_autoincrement.down.sql b/riverdriver/riverdatabasesql/migration/main/008_job_id_autoincrement.down.sql index 695357bb8..0bad60286 100644 --- a/riverdriver/riverdatabasesql/migration/main/008_job_id_autoincrement.down.sql +++ b/riverdriver/riverdatabasesql/migration/main/008_job_id_autoincrement.down.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/riverdriver/riverdatabasesql/migration/main/008_job_id_autoincrement.up.sql b/riverdriver/riverdatabasesql/migration/main/008_job_id_autoincrement.up.sql index 695357bb8..0bad60286 100644 --- a/riverdriver/riverdatabasesql/migration/main/008_job_id_autoincrement.up.sql +++ b/riverdriver/riverdatabasesql/migration/main/008_job_id_autoincrement.up.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/riverdriver/riverdatabasesql/yugabyte_compatibility_test.go b/riverdriver/riverdatabasesql/yugabyte_compatibility_test.go index a4d9fcf51..8d137975e 100644 --- a/riverdriver/riverdatabasesql/yugabyte_compatibility_test.go +++ b/riverdriver/riverdatabasesql/yugabyte_compatibility_test.go @@ -14,7 +14,7 @@ import ( func TestYugabyteCompatibility(t *testing.T) { t.Parallel() - // YugabyteDB doesn't expose PostgreSQL's transaction-related system columns: + // YugabyteDB doesn't expose Postgres's transaction-related system columns: // https://docs.yugabyte.com/stable/yugabyte-voyager/known-issues/postgresql/#system-columns-is-not-yet-supported // The unique insert query may use xmax only because the entire expression is // replaced when the driver detects YugabyteDB. @@ -52,6 +52,6 @@ func TestYugabyteCompatibility(t *testing.T) { require.NoError(t, err) require.Empty(t, violations, - "YugabyteDB-incompatible PostgreSQL system columns must only appear inside SQL templates that replace them for YugabyteDB", + "YugabyteDB-incompatible Postgres system columns must only appear inside SQL templates that replace them for YugabyteDB", ) } diff --git a/riverdriver/riverdrivertest/benchmark.go b/riverdriver/riverdrivertest/benchmark.go index dde1e0862..682123601 100644 --- a/riverdriver/riverdrivertest/benchmark.go +++ b/riverdriver/riverdrivertest/benchmark.go @@ -216,7 +216,7 @@ func Benchmark[TTx any](ctx context.Context, b *testing.B, for _, tc := range testCases { b.Run(tc.name, func(b *testing.B) { largeMetadata := makeBenchmarkMetadataWithRiverLogSize(tc.metadataSizeBytes) - // Match PostgreSQL's timestamp precision so the inserted + // Match Postgres's timestamp precision so the inserted // scheduled_at can't round past the fetch cutoff. now := time.Now().UTC().Truncate(time.Microsecond) diff --git a/riverdriver/riverdrivertest/client_job_update_test.go b/riverdriver/riverdrivertest/client_job_update_test.go index 11e792cf5..e1b185e33 100644 --- a/riverdriver/riverdrivertest/client_job_update_test.go +++ b/riverdriver/riverdrivertest/client_job_update_test.go @@ -93,7 +93,7 @@ func exerciseClientJobUpdate[TTx any](ctx context.Context, t *testing.T, bundle := setup(t) if bundle.driver.DatabaseName() != riverdriver.DatabaseNamePostgres { - t.Skip("the retry race requires PostgreSQL row locking and statement snapshots") + t.Skip("the retry race requires Postgres row locking and statement snapshots") } // Hold the winner's row lock until the loser is waiting on it, so the diff --git a/riverdriver/riverdrivertest/driver_client_test.go b/riverdriver/riverdrivertest/driver_client_test.go index 160eff4c0..5dca04ec4 100644 --- a/riverdriver/riverdrivertest/driver_client_test.go +++ b/riverdriver/riverdrivertest/driver_client_test.go @@ -929,7 +929,7 @@ func ExerciseClient[TTx any](ctx context.Context, t *testing.T, client, bundle := setup(t) if bundle.driver.DatabaseName() != riverdriver.DatabaseNamePostgres { - t.Skip("uses PostgreSQL array and JSON containment syntax") + t.Skip("uses Postgres array and JSON containment syntax") } now := time.Now().UTC().Truncate(time.Second) wantIDs := make([]int64, 0, 3) diff --git a/riverdriver/riverdrivertest/executor_tx.go b/riverdriver/riverdrivertest/executor_tx.go index 8d43b60df..65e1372db 100644 --- a/riverdriver/riverdrivertest/executor_tx.go +++ b/riverdriver/riverdrivertest/executor_tx.go @@ -379,7 +379,7 @@ func exerciseExecutorTx[TTx any](ctx context.Context, t *testing.T, // unless the legacy fallback is explicitly enabled. driver, schema := driverWithSchema(ctx, t, nil) if driver.DatabaseName() != riverdriver.DatabaseNamePostgres { - t.Skip("uses PostgreSQL tuple transaction IDs to detect hidden subtransactions") + t.Skip("uses Postgres tuple transaction IDs to detect hidden subtransactions") } tx, err := driver.GetExecutor().Begin(ctx) require.NoError(t, err) @@ -388,7 +388,7 @@ func exerciseExecutorTx[TTx any](ctx context.Context, t *testing.T, // Include a write directly in the caller's transaction so that // even one savepoint encompassing all helper writes is detected. _ = testfactory.Job(ctx, t, tx, &testfactory.JobOpts{Schema: schema}) - const numJobs = 80 // Exceeds PostgreSQL's cached subtransaction ID limit. + const numJobs = 80 // Exceeds Postgres's cached subtransaction ID limit. for range numJobs { require.NoError(t, dbutil.WithTx(ctx, tx, func(ctx context.Context, execTx riverdriver.ExecutorTx) error { return dbutil.WithTx(ctx, execTx, func(ctx context.Context, execTx riverdriver.ExecutorTx) error { diff --git a/riverdriver/riverpgxv5/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql b/riverdriver/riverpgxv5/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql index bed717f87..9dd01264c 100644 --- a/riverdriver/riverpgxv5/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql +++ b/riverdriver/riverpgxv5/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql @@ -47,7 +47,7 @@ ALTER TABLE /* TEMPLATE: schema */river_queue -- -- SQLite JSONB conversion rollback. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- Notification outbox rollback. diff --git a/riverdriver/riverpgxv5/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql b/riverdriver/riverpgxv5/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql index 39e3249c9..41fabc912 100644 --- a/riverdriver/riverpgxv5/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql +++ b/riverdriver/riverpgxv5/migration/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql @@ -16,7 +16,7 @@ CREATE INDEX river_notification_topic_id_idx ON /* TEMPLATE: schema */river_noti -- -- SQLite JSONB conversion. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- SQL cleanup. diff --git a/riverdriver/riverpgxv5/migration/main/008_job_id_autoincrement.down.sql b/riverdriver/riverpgxv5/migration/main/008_job_id_autoincrement.down.sql index 695357bb8..0bad60286 100644 --- a/riverdriver/riverpgxv5/migration/main/008_job_id_autoincrement.down.sql +++ b/riverdriver/riverpgxv5/migration/main/008_job_id_autoincrement.down.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/riverdriver/riverpgxv5/migration/main/008_job_id_autoincrement.up.sql b/riverdriver/riverpgxv5/migration/main/008_job_id_autoincrement.up.sql index 695357bb8..0bad60286 100644 --- a/riverdriver/riverpgxv5/migration/main/008_job_id_autoincrement.up.sql +++ b/riverdriver/riverpgxv5/migration/main/008_job_id_autoincrement.up.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/riverdriver/riverpgxv5/yugabyte_compatibility_test.go b/riverdriver/riverpgxv5/yugabyte_compatibility_test.go index 57aafa691..79c5d5ba1 100644 --- a/riverdriver/riverpgxv5/yugabyte_compatibility_test.go +++ b/riverdriver/riverpgxv5/yugabyte_compatibility_test.go @@ -14,7 +14,7 @@ import ( func TestYugabyteCompatibility(t *testing.T) { t.Parallel() - // YugabyteDB doesn't expose PostgreSQL's transaction-related system columns: + // YugabyteDB doesn't expose Postgres's transaction-related system columns: // https://docs.yugabyte.com/stable/yugabyte-voyager/known-issues/postgresql/#system-columns-is-not-yet-supported // The unique insert query may use xmax only because the entire expression is // replaced when the driver detects YugabyteDB. @@ -52,6 +52,6 @@ func TestYugabyteCompatibility(t *testing.T) { require.NoError(t, err) require.Empty(t, violations, - "YugabyteDB-incompatible PostgreSQL system columns must only appear inside SQL templates that replace them for YugabyteDB", + "YugabyteDB-incompatible Postgres system columns must only appear inside SQL templates that replace them for YugabyteDB", ) } diff --git a/riverdriver/riversqlite/migration/main/008_job_id_autoincrement.up.sql b/riverdriver/riversqlite/migration/main/008_job_id_autoincrement.up.sql index c7de15deb..6ee4b32c7 100644 --- a/riverdriver/riversqlite/migration/main/008_job_id_autoincrement.up.sql +++ b/riverdriver/riversqlite/migration/main/008_job_id_autoincrement.up.sql @@ -1,5 +1,5 @@ -- Rebuild river_job so automatically generated IDs are never reused after the --- job holding the largest ID is deleted. Unlike PostgreSQL sequences, SQLite's +-- job holding the largest ID is deleted. Unlike Postgres sequences, SQLite's -- default ROWID allocator may otherwise reuse that deleted ID. -- Rebuilding river_job would discard schema installed by River Pro. Check diff --git a/riverdriver/riversqlite/river_sqlite_driver.go b/riverdriver/riversqlite/river_sqlite_driver.go index 73ae1430c..1fefd422a 100644 --- a/riverdriver/riversqlite/river_sqlite_driver.go +++ b/riverdriver/riversqlite/river_sqlite_driver.go @@ -381,14 +381,14 @@ func (e *Executor) JobCountByQueueAndState(ctx context.Context, params *riverdri return nil, interpretError(err) } - // The PostgreSQL drivers implement this query with an `all_queues` CTE and + // The Postgres drivers implement this query with an `all_queues` CTE and // LEFT JOINs, so they return one row per requested queue, including queues // that currently have no jobs. The input queue list is deduplicated in SQL. // The SQLite sqlc driver only reliably supports `sqlc.slice` in `IN (...)`, // and we haven't found a workable way to bind a parameterized list through // `json_each(...)` to produce equivalent SQL. The SQLite SQL query therefore // returns only queues with matching rows, and this wrapper fills in missing - // queues to match PostgreSQL behavior. + // queues to match Postgres behavior. countsByQueue := make(map[string]struct { CountAvailable int64 CountRunning int64 @@ -643,7 +643,7 @@ func (e *Executor) JobInsertFastMany(ctx context.Context, params *riverdriver.Jo uniqueNoncesInBatch := make(map[string]bool, len(params.Jobs)) uniqueKeysInBatch := make(map[string]bool, len(params.Jobs)) for i, job := range params.Jobs { - // PostgreSQL rejects a statement that affects the same unique row twice. + // Postgres rejects a statement that affects the same unique row twice. // SQLite allows it, so reject repeated keys covered by the unique index. if len(job.UniqueKey) > 0 && job.UniqueStates&uniquestates.UniqueStatesToBitmask([]rivertype.JobState{job.State}) != 0 { key := string(job.UniqueKey) diff --git a/riverdriver/unique_insert.go b/riverdriver/unique_insert.go index c03db5c9e..c5332c306 100644 --- a/riverdriver/unique_insert.go +++ b/riverdriver/unique_insert.go @@ -6,7 +6,7 @@ import ( ) // UniqueInsertMetadataKey is a reserved job metadata key used to detect unique -// insert conflicts on databases that don't expose PostgreSQL system columns. +// insert conflicts on databases that don't expose Postgres system columns. const UniqueInsertMetadataKey = "river:unique_nonce" // UniqueInsertMode is a database-specific strategy for detecting whether a @@ -23,11 +23,11 @@ const ( // contains it. UniqueInsertModeMetadataNonce - // UniqueInsertModeReturningOld uses PostgreSQL 18's OLD row support in + // UniqueInsertModeReturningOld uses Postgres 18's OLD row support in // RETURNING. UniqueInsertModeReturningOld - // UniqueInsertModeXmax uses PostgreSQL's xmax system column. + // UniqueInsertModeXmax uses Postgres's xmax system column. UniqueInsertModeXmax ) @@ -104,7 +104,7 @@ func UniqueInsertMetadataWithNonce(metadata []byte, nonce string) ([]byte, error } // UniqueInsertModeFromProductAndVersion returns the unique insert mode -// appropriate for a database product and its PostgreSQL-compatible server +// appropriate for a database product and its Postgres-compatible server // version number. func UniqueInsertModeFromProductAndVersion(product string, version int32) UniqueInsertMode { if postgresProductIsYugabyte(product) { diff --git a/riverdriver/unique_insert_test.go b/riverdriver/unique_insert_test.go index 0a764ddf5..64d55ef5f 100644 --- a/riverdriver/unique_insert_test.go +++ b/riverdriver/unique_insert_test.go @@ -100,13 +100,13 @@ func TestUniqueInsertMetadataWithNonce(t *testing.T) { func TestUniqueInsertModeFromProductAndVersion(t *testing.T) { t.Parallel() - t.Run("PostgreSQL17", func(t *testing.T) { + t.Run("Postgres17", func(t *testing.T) { t.Parallel() require.Equal(t, UniqueInsertModeXmax, UniqueInsertModeFromProductAndVersion("PostgreSQL 17.5", 170_005)) }) - t.Run("PostgreSQL18", func(t *testing.T) { + t.Run("Postgres18", func(t *testing.T) { t.Parallel() require.Equal(t, UniqueInsertModeReturningOld, UniqueInsertModeFromProductAndVersion("PostgreSQL 18.0", 180_000)) @@ -118,7 +118,7 @@ func TestUniqueInsertModeFromProductAndVersion(t *testing.T) { require.Equal(t, UniqueInsertModeMetadataNonce, UniqueInsertModeFromProductAndVersion("YugabyteDB", 180_000)) }) - t.Run("YugabytePostgreSQLVersion", func(t *testing.T) { + t.Run("YugabytePostgresVersion", func(t *testing.T) { t.Parallel() require.Equal(t, UniqueInsertModeMetadataNonce, UniqueInsertModeFromProductAndVersion("PostgreSQL 15.2-YB-2.25.1.0-b0", 150_002)) diff --git a/rivershared/riversharedtest/yugabyte.go b/rivershared/riversharedtest/yugabyte.go index abb5c870e..5821efc68 100644 --- a/rivershared/riversharedtest/yugabyte.go +++ b/rivershared/riversharedtest/yugabyte.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/require" ) -// DBPoolWithYugabyteVersion returns a PostgreSQL pool that reports a Yugabyte +// DBPoolWithYugabyteVersion returns a Postgres pool that reports a Yugabyte // version and LISTEN/NOTIFY setting. A nil setting simulates versions where it -// doesn't exist. This exercises detection on ordinary PostgreSQL; it does not +// doesn't exist. This exercises detection on ordinary Postgres; it does not // emulate Yugabyte's storage or transaction semantics. // // The schema must be isolated to this test. When notifications are disabled, diff --git a/ruby/CHANGELOG.md b/ruby/CHANGELOG.md index 1381b2986..1e04757e2 100644 --- a/ruby/CHANGELOG.md +++ b/ruby/CHANGELOG.md @@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Cancellation wins atomically over discarded attempts and other state transitions, including the last attempt or a worker that disables retries. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Stuck-job rescue falls back to the default retry policy per job when an application policy fails or returns an invalid time, allowing recovery and cleanup to continue. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Clients without consumer queues run configured periodic jobs and maintenance services. Adding periodic jobs starts maintenance when needed; registration is rejected when leader election is disabled. [PR #1463](https://github.com/riverqueue/river/pull/1463). -- Bulk deletion excludes running jobs before applying its limit and locks eligible PostgreSQL rows so concurrent retries cannot cause deletion of jobs that no longer match the filters. [PR #1463](https://github.com/riverqueue/river/pull/1463). +- Bulk deletion excludes running jobs before applying its limit and locks eligible Postgres rows so concurrent retries cannot cause deletion of jobs that no longer match the filters. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Stuck-job rescue respects longer or disabled client and worker timeouts and scans past protected attempts without consuming the rescue limit. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Snoozing and rescue tolerate JSON counters that overflow SQLite's floating-point representation. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Snoozing tolerates nonnumeric metadata counters instead of failing on booleans or collections. Ruby-specific recovery cases are tested independently of the shared Go fixtures. [PR #1463](https://github.com/riverqueue/river/pull/1463). @@ -47,21 +47,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Custom maintenance service failures are logged without blocking other services, stuck-job rescue, or cleanup. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Job updates reject non-object metadata before writing to the database, preserving the existing job when invalid metadata is supplied. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Job completion atomically checks for cancellation so a concurrent cancellation cannot be overwritten by completion, including when finalization hooks are configured. [PR #1463](https://github.com/riverqueue/river/pull/1463). -- Job updates reject nonpositive attempt limits consistently on PostgreSQL and SQLite. [PR #1463](https://github.com/riverqueue/river/pull/1463). +- Job updates reject nonpositive attempt limits consistently on Postgres and SQLite. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Job lifecycle events report worker execution and completion durations separately using a monotonic clock. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Finalization hooks that delete jobs honor concurrent cancellation and record the cancelled attempt instead of deleting it. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Queue metadata writes and job metadata merges reject non-object values before changing persisted data. Job updates also reject non-string worker IDs in attempt histories. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Unique inserts with `exclude_kind` preserve the existing job's kind when a different kind conflicts, on both databases and through both drivers. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Retrying, snoozing, and interrupting jobs preserve the original queue-wait duration in lifecycle events. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Invalid rescue counters no longer prevent other stuck jobs in the batch from being rescued. [PR #1463](https://github.com/riverqueue/river/pull/1463). -- SQLite retains only the newest 100 worker IDs when claiming a job, matching PostgreSQL. [PR #1463](https://github.com/riverqueue/river/pull/1463). +- SQLite retains only the newest 100 worker IDs when claiming a job, matching Postgres. [PR #1463](https://github.com/riverqueue/river/pull/1463). - Attempt-error serialization supports frozen timestamps and preserves the caller's timezone. [PR #1463](https://github.com/riverqueue/river/pull/1463). ## [0.12.0] - 2026-10-01 ### Added -- Add a full Ruby client for River with Go-compatible job insertion and execution on PostgreSQL, SQLite, and YugabyteDB through ActiveRecord or Sequel. Includes workers, retries, cancellation, periodic and resumable jobs, job-persisted logging, job administration, migration and worker CLIs, and testing helpers. Rails and Active Job integration is available through `riverqueue-rails`, with workflows, batches, sequences, concurrency controls, and other advanced features in the separately distributed `riverqueue-pro` gem. [PR #70](https://github.com/riverqueue/riverqueue-ruby/pull/70). +- Add a full Ruby client for River with Go-compatible job insertion and execution on Postgres, SQLite, and YugabyteDB through ActiveRecord or Sequel. Includes workers, retries, cancellation, periodic and resumable jobs, job-persisted logging, job administration, migration and worker CLIs, and testing helpers. Rails and Active Job integration is available through `riverqueue-rails`, with workflows, batches, sequences, concurrency controls, and other advanced features in the separately distributed `riverqueue-pro` gem. [PR #70](https://github.com/riverqueue/riverqueue-ruby/pull/70). ## [0.11.0] - 2026-09-02 @@ -71,7 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Stop pulling in `pg` as a hard dependency of either driver. Applications now select their database adapter by including `pg` for PostgreSQL or `sqlite3` for SQLite. [PR #67](https://github.com/riverqueue/riverqueue-ruby/pull/67). +- Stop pulling in `pg` as a hard dependency of either driver. Applications now select their database adapter by including `pg` for Postgres or `sqlite3` for SQLite. [PR #67](https://github.com/riverqueue/riverqueue-ruby/pull/67). ## [0.10.1] - 2026-04-09 diff --git a/ruby/Makefile b/ruby/Makefile index 0b30b2f8c..f6d142fb0 100644 --- a/ruby/Makefile +++ b/ruby/Makefile @@ -7,7 +7,7 @@ TEST_JOBS ?= 4 generate/fixtures: $(MAKE) -C .. generate/fixtures -test/conformance: generate/fixtures ## Run the Go-generated fixture checks without PostgreSQL +test/conformance: generate/fixtures ## Run the Go-generated fixture checks without Postgres bundle exec rspec spec/conformance_spec.rb .PHONY: test/yugabyte diff --git a/ruby/README.md b/ruby/README.md index 8d9fcefb2..82f30b933 100644 --- a/ruby/README.md +++ b/ruby/README.md @@ -1,6 +1,6 @@ # River for Ruby -A PostgreSQL and SQLite job queue that shares River's schema with the Go, Rust, +A Postgres and SQLite job queue that shares River's schema with the Go, Rust, and JavaScript clients. Includes Active Record and Sequel drivers, plus Rails and Active Job integration. @@ -19,4 +19,4 @@ make lint/ruby typecheck/ruby ``` Ruby 3.2 or later is required. `make test/ruby/conformance` runs only the -Go-generated fixture checks and needs no PostgreSQL server. +Go-generated fixture checks and needs no Postgres server. diff --git a/ruby/docs/README.md b/ruby/docs/README.md index 46a69c45c..84836132f 100644 --- a/ruby/docs/README.md +++ b/ruby/docs/README.md @@ -26,9 +26,9 @@ its uniqueness and notification capabilities. ## Schema and migrations Run migrations before inserting jobs or starting workers. The bundled `river` -command uses Go's canonical PostgreSQL and SQLite migrations; no Go installation +command uses Go's canonical Postgres and SQLite migrations; no Go installation is needed. After installing a River driver and its database adapter, create your -application's PostgreSQL database and run: +application's Postgres database and run: ```sh export DATABASE_URL=postgres://localhost/my_app @@ -57,7 +57,7 @@ both are in your bundle. For River Pro, install `riverqueue-pro`, apply the main migrations above, then run `bundle exec river migrate-up --line pro` against the same database. -See the [migration guide](migrations.md) for the Ruby API, PostgreSQL schemas, +See the [migration guide](migrations.md) for the Ruby API, Postgres schemas, target versions, downgrade precautions, and existing SQLite Pro installations. Test schema snapshots under `spec/support` are test-only and must not be used to provision production databases. @@ -160,7 +160,7 @@ For simple jobs, `River::JobArgsHash.new(:kind, hash)` avoids defining an argume ### [Transactional enqueueing](https://riverqueue.com/docs/transactional-enqueueing) Insertion hooks and middleware execute inside the insertion transaction. If -they raise, their database writes and the enqueue roll back together. PostgreSQL +they raise, their database writes and the enqueue roll back together. Postgres insert notifications are delivered only when the surrounding transaction commits. Inserts automatically join a transaction opened through the same Active Record connection or Sequel database object. A rollback also rolls back the job: diff --git a/ruby/docs/conformance.md b/ruby/docs/conformance.md index 19ab485ba..9b1e8aec3 100644 --- a/ruby/docs/conformance.md +++ b/ruby/docs/conformance.md @@ -9,7 +9,7 @@ make test/ruby/conformance ``` This generates `conformance/testdata/` and runs `ruby/spec/conformance_spec.rb`. -No PostgreSQL server, pinned upstream checkout, protocol adapter, or separately +No Postgres server, pinned upstream checkout, protocol adapter, or separately maintained golden files are needed. Missing fixtures fail with instructions to regenerate them. The regular Ruby suite includes these checks too. @@ -29,7 +29,7 @@ The fixture checks cover: The Ruby workflow runs on Ruby changes. The shared Conformance workflow also runs these tests when Go code changes. The ordinary driver suites retain -PostgreSQL notification delivery/commit-ordering tests and shared PostgreSQL / +Postgres notification delivery/commit-ordering tests and shared Postgres / SQLite insertion, transaction, uniqueness, and worker tests. This replaces the old `insert-only-v1` adapter and its pinned external harness. @@ -39,17 +39,17 @@ protocol is not part of the Ruby API. ## Coverage gaps and API differences -Ruby's runtime still polls job and queue state rather than consuming PostgreSQL +Ruby's runtime still polls job and queue state rather than consuming Postgres LISTEN events or the SQLite outbox. The fixture target checks notification emission, not dispatch. Ruby does not emit or handle `request_resign`; other clients' requests therefore cannot force a Ruby leader to resign. Completing that coverage would require a notification listener and runtime dispatch path. -The ordinary driver suites verify PostgreSQL delivery, commit ordering, and +The ordinary driver suites verify Postgres delivery, commit ordering, and rollback for queue controls and resignations as well as insertion/cancellation. Shared snooze-counter fixtures cover non-negative integers and absent counters. Recovery from other JSON values is implementation-specific. Ruby's shared driver -tests cover its lenient conversion rules separately on PostgreSQL and SQLite. +tests cover its lenient conversion rules separately on Postgres and SQLite. Cron retains Ruby's existing Fugit extensions: six fields with seconds, Sunday as 7, hour 24, and descending ranges. These four expressions are accepted in diff --git a/ruby/docs/development.md b/ruby/docs/development.md index 802d3457d..62dbd6766 100644 --- a/ruby/docs/development.md +++ b/ruby/docs/development.md @@ -36,18 +36,18 @@ Package suites run in separate processes, four at a time by default. Set `TEST_JOBS=1` for serial execution, or choose another concurrency with `make test TEST_JOBS=2`. Each package retains its own coverage checks. -CI runs Ruby 4.0 against PostgreSQL 14–18, and Ruby 3.2–3.4 against PostgreSQL 18. +CI runs Ruby 4.0 against Postgres 14–18, and Ruby 3.2–3.4 against Postgres 18. SQLite and conformance checks run separately on Ruby 4.0. One Rails job tests -Rails 7.2, 8.0, and 8.1 on Ruby 4.0, reusing its PostgreSQL service and gems. +Rails 7.2, 8.0, and 8.1 on Ruby 4.0, reusing its Postgres service and gems. Use `TEST_DATABASE=postgres` or `TEST_DATABASE=sqlite` to select a backend; the default is `all`. CI merges the core and driver coverage reports from -PostgreSQL and SQLite to enforce 100% line and branch coverage. Filtered local +Postgres and SQLite to enforce 100% line and branch coverage. Filtered local runs collect coverage without enforcing that threshold individually. Real database tests run by default. `RIVER_REQUIRE_DATABASES=1` requires both the selected databases to be available instead of permitting local skips. CI -also requires them. Set `TEST_DATABASE_URL` to override the PostgreSQL test +also requires them. Set `TEST_DATABASE_URL` to override the Postgres test database URL. Tests create and migrate disposable schemas with the bundled SQL; the database user must be able to create and drop schemas. No existing River tables are needed. The Go toolchain from `../go.work` is required to generate the conformance fixtures before running core tests. @@ -58,19 +58,19 @@ speed is independent of existing data in `public`, which is left untouched. Both driver packages run the same insertion and runtime contracts from `spec/driver_shared_examples.rb` and `spec/driver_runtime_shared_examples.rb` -against PostgreSQL and SQLite. These cover job state transitions, scheduling, +against Postgres and SQLite. These cover job state transitions, scheduling, rescue, metadata, filtering, deletion, transactions, queues, and leadership. Adapter-specific conversion tests remain in each driver's suite. The driver suites also exercise Go-style Yugabyte capability simulations on -PostgreSQL. For actual YSQL storage/transaction checks, run `make test/yugabyte` +Postgres. For actual YSQL storage/transaction checks, run `make test/yugabyte` with `YUGABYTE_DATABASE_URL` pointing to a disposable database. See [Yugabyte verification](yugabyte.md#verification). `spec/client_driver_shared_examples.rb` additionally starts real worker threads for each combination, testing transaction visibility and rollback, committed bulk insertion, output, retries, and exhausted jobs. These tests need committed -data, so they use disposable PostgreSQL schemas and temporary file-backed SQLite +data, so they use disposable Postgres schemas and temporary file-backed SQLite databases, initialized by batching the bundled canonical migration SQL, not the shared public job tables. Migration tests still use `River::Migrator`, covering upgrades, downgrades, legacy history, rollback, and populated data. See [migrations](migrations.md) @@ -82,10 +82,10 @@ for both SQL adapters and Rails. Generate fixtures first with ## Conformance and migrations -`make test/conformance` checks shared Go-generated fixtures without PostgreSQL. +`make test/conformance` checks shared Go-generated fixtures without Postgres. See [conformance](conformance.md) for coverage and known parity gaps. -`make verify` checks bundled PostgreSQL and SQLite migrations against the +`make verify` checks bundled Postgres and SQLite migrations against the canonical files in `../riverdriver/`, including filenames, bytes, license, and manifest checksums. It requires only Ruby, not installed gems or a database. Run `ruby scripts/sync_migrations.rb` to update the bundle after Go migrations diff --git a/ruby/docs/migrating_from_sidekiq.md b/ruby/docs/migrating_from_sidekiq.md index a11785332..9879af971 100644 --- a/ruby/docs/migrating_from_sidekiq.md +++ b/ruby/docs/migrating_from_sidekiq.md @@ -7,13 +7,13 @@ Pin and verify a release or repository revision containing these APIs before changing an application; do not assume an older installed gem supports them. Sidekiq references were checked on September 7, 2026. -River stores jobs in PostgreSQL or SQLite and can insert them in the same +River stores jobs in Postgres or SQLite and can insert them in the same transaction as application records. Workers run in Ruby threads. Redis payloads are not River rows: changing gems alone does not move existing jobs. ## Why migrate to River? -For applications already using PostgreSQL or SQLite, River offers: +For applications already using Postgres or SQLite, River offers: - **Atomic enqueueing:** application changes and jobs commit or roll back together in one database transaction. Sidekiq's @@ -83,7 +83,7 @@ third-party extensions, rather than mapping the purchased edition as a whole. ## 2. Install a driver and provision the schema -For an Active Record application using PostgreSQL: +For an Active Record application using Postgres: ```ruby # Gemfile: keep Sidekiq while it drains existing work. diff --git a/ruby/docs/migrations.md b/ruby/docs/migrations.md index 2640c11be..c0d1b5717 100644 --- a/ruby/docs/migrations.md +++ b/ruby/docs/migrations.md @@ -1,7 +1,7 @@ # Schema migrations River Ruby includes a migration API and the `river` command. Neither needs -Go installed. The gems bundle byte-for-byte copies of the PostgreSQL and SQLite +Go installed. The gems bundle byte-for-byte copies of the Postgres and SQLite SQL from Go's River drivers, pinned to release v0.48.0 through migration 008; only the upstream schema template placeholders are substituted when executing them. @@ -24,7 +24,7 @@ bundle exec river migrate-up --database-url sqlite://storage/river.sqlite3 `DATABASE_URL` supplies the URL when `--database-url` is omitted. ActiveRecord uses `sqlite3:` URLs instead of Sequel's `sqlite:` URLs. To target an existing -PostgreSQL schema, pass `--schema jobs`; otherwise the connection's current +Postgres schema, pass `--schema jobs`; otherwise the connection's current schema is used. Schema names must be simple SQL identifiers. SQLite always uses its main schema. @@ -52,12 +52,12 @@ migrator.migrate(dry_run: true, target: 8) migrator.migrate(direction: :down) # One version; no interactive confirmation. ``` -The API accepts either driver and optionally `schema:` for PostgreSQL. `migrate` +The API accepts either driver and optionally `schema:` for Postgres. `migrate` returns the migration records applied (or planned in dry-run mode), with their version, name, and original up/down SQL. Each version's SQL and history update commit in their own transaction. A failing version rolls back while earlier versions remain committed, so rerunning resumes safely. Do not wrap the migrator -in an application transaction: some PostgreSQL changes require a real commit +in an application transaction: some Postgres changes require a real commit before the next version can run. An up migration targeting an already-applied version does nothing, even when @@ -75,7 +75,7 @@ Pro SQL is distributed only inside `riverqueue-pro`, not the public core gem. SQLite main migration 008 rebuilds `river_job` with `AUTOINCREMENT` so deleted job IDs are not reused. Its upgrade and downgrade refuse to run while Pro's workflow/sequence schema is installed; coordinate that upgrade with Pro before -running it on an existing Pro database. PostgreSQL migration 008 is a no-op. +running it on an existing Pro database. Postgres migration 008 is a no-op. Migrate main first, then Pro: @@ -92,7 +92,7 @@ River::Pro::Migrator.new(driver).migrate ``` Remove other migration lines before downgrading main. Run only one migration -process at a time across languages. Ruby migrators take a PostgreSQL advisory +process at a time across languages. Ruby migrators take a Postgres advisory lock per schema; SQLite takes a write lock per version and checks for concurrent history changes. These are not shared locks with Go's migration runner. diff --git a/ruby/docs/testing.md b/ruby/docs/testing.md index e6afa9647..47b08ecfa 100644 --- a/ruby/docs/testing.md +++ b/ruby/docs/testing.md @@ -1,6 +1,6 @@ # Testing River jobs -Testing helpers ship in `riverqueue`. They use your real PostgreSQL or SQLite +Testing helpers ship in `riverqueue`. They use your real Postgres or SQLite database through either driver; there is no fake queue, global testing mode, implicit migration, or automatic cleanup. Require them explicitly: diff --git a/ruby/docs/yugabyte.md b/ruby/docs/yugabyte.md index 31428507b..8582f4d67 100644 --- a/ruby/docs/yugabyte.md +++ b/ruby/docs/yugabyte.md @@ -1,9 +1,9 @@ # YugabyteDB -Both SQL drivers support YugabyteDB through its PostgreSQL-compatible YSQL -endpoint. Use the `pg` gem and the usual PostgreSQL connection configuration; +Both SQL drivers support YugabyteDB through its Postgres-compatible YSQL +endpoint. Use the `pg` gem and the usual Postgres connection configuration; no separate River driver or client flag is required. Apply the bundled -[PostgreSQL migrations](migrations.md). +[Postgres migrations](migrations.md). ```ruby db = Sequel.connect("postgres://yugabyte@localhost:5433/my_app") @@ -21,11 +21,11 @@ Ruby follows Go's database detection and unique-insert strategies: | Server | Duplicate detection | | --- | --- | | YugabyteDB | A random nonce in reserved metadata `river:unique_nonce` | -| PostgreSQL 18+ | `OLD.id IS NOT NULL` in `RETURNING` | -| Earlier PostgreSQL | `xmax != 0` | +| Postgres 18+ | `OLD.id IS NOT NULL` in `RETURNING` | +| Earlier Postgres | `xmax != 0` | -Yugabyte's product identification takes precedence over its PostgreSQL version. -The nonce is generated per returning insert batch, just as in Go's PostgreSQL +Yugabyte's product identification takes precedence over its Postgres version. +The nonce is generated per returning insert batch, just as in Go's Postgres drivers. Existing jobs without a nonce are still recognized as duplicates; application metadata is preserved, apart from the reserved nonce key. @@ -59,7 +59,7 @@ not replay application transactions or hooks automatically. ## Verification -Normal driver tests mirror Go's PostgreSQL-based Yugabyte simulations, covering +Normal driver tests mirror Go's Postgres-based Yugabyte simulations, covering an absent, disabled, or enabled notification setting. Disabled simulations make `pg_notify` raise to detect accidental broadcasts. These do not emulate Yugabyte's storage or transaction semantics. diff --git a/ruby/driver/riverqueue-activerecord/docs/README.md b/ruby/driver/riverqueue-activerecord/docs/README.md index aa51a8a01..fee97a649 100644 --- a/ruby/driver/riverqueue-activerecord/docs/README.md +++ b/ruby/driver/riverqueue-activerecord/docs/README.md @@ -1,6 +1,6 @@ # riverqueue-activerecord -[ActiveRecord](https://guides.rubyonrails.org/active_record_basics.html) driver for [River](https://github.com/riverqueue/river)'s [`riverqueue` gem for Ruby](https://rubygems.org/gems/riverqueue). PostgreSQL and SQLite are supported. +[ActiveRecord](https://guides.rubyonrails.org/active_record_basics.html) driver for [River](https://github.com/riverqueue/river)'s [`riverqueue` gem for Ruby](https://rubygems.org/gems/riverqueue). Postgres and SQLite are supported. Add this driver and only the database adapter used by the application to `Gemfile`. The driver pulls in the core gem: @@ -10,7 +10,7 @@ gem "riverqueue-activerecord" gem "pg" # or: gem "sqlite3" ``` -For PostgreSQL, add `pg` to `Gemfile`: +For Postgres, add `pg` to `Gemfile`: ```ruby gem "pg" @@ -42,7 +42,7 @@ client = River::Client.new(River::Driver::ActiveRecord.new) Use current River migrations to create and update the SQLite database. -YugabyteDB is supported through the PostgreSQL adapter, with automatic capability +YugabyteDB is supported through the Postgres adapter, with automatic capability detection. See [YugabyteDB setup and behavior](../../../docs/yugabyte.md). ## Development diff --git a/ruby/driver/riverqueue-activerecord/docs/development.md b/ruby/driver/riverqueue-activerecord/docs/development.md index c9b88ad9a..953495f57 100644 --- a/ruby/driver/riverqueue-activerecord/docs/development.md +++ b/ruby/driver/riverqueue-activerecord/docs/development.md @@ -15,7 +15,7 @@ $ createdb river_test Tests migrate their own disposable schemas using the bundled SQL and leave existing tables untouched. The database user needs permission to create and drop -schemas. Set `TEST_DATABASE_URL` to use a different PostgreSQL database. +schemas. Set `TEST_DATABASE_URL` to use a different Postgres database. Generate shared fixtures from the repository root with `make generate/fixtures` before invoking the driver specs directly. diff --git a/ruby/driver/riverqueue-activerecord/lib/driver.rb b/ruby/driver/riverqueue-activerecord/lib/driver.rb index b99a2225a..2f45e0d9e 100644 --- a/ruby/driver/riverqueue-activerecord/lib/driver.rb +++ b/ruby/driver/riverqueue-activerecord/lib/driver.rb @@ -3,7 +3,7 @@ require "securerandom" module River::Driver - # Provides an ActiveRecord driver for River supporting PostgreSQL, YugabyteDB, + # Provides an ActiveRecord driver for River supporting Postgres, YugabyteDB, # and SQLite. # # Used in conjunction with a River client like: @@ -17,7 +17,7 @@ class ActiveRecord # Connection class whose pool and transaction context this driver uses. attr_reader :connection_class - # Uses an established PostgreSQL or SQLite connection. The class must be + # Uses an established Postgres or SQLite connection. The class must be # ActiveRecord::Base or an abstract Active Record class. Routing follows its # current role/shard; configure consumers explicitly for each database. def initialize(connection_class: ::ActiveRecord::Base) diff --git a/ruby/driver/riverqueue-activerecord/riverqueue-activerecord.gemspec b/ruby/driver/riverqueue-activerecord/riverqueue-activerecord.gemspec index e54cc6fde..e85a28c6d 100644 --- a/ruby/driver/riverqueue-activerecord/riverqueue-activerecord.gemspec +++ b/ruby/driver/riverqueue-activerecord/riverqueue-activerecord.gemspec @@ -3,8 +3,8 @@ Gem::Specification.new do |s| s.name = "riverqueue-activerecord" s.version = "0.13.0" - s.summary = "ActiveRecord PostgreSQL and SQLite driver for the River Ruby gem." - s.description = "ActiveRecord PostgreSQL and SQLite driver for inserting and working River jobs in Ruby." + s.summary = "ActiveRecord Postgres and SQLite driver for the River Ruby gem." + s.description = "ActiveRecord Postgres and SQLite driver for inserting and working River jobs in Ruby." s.authors = ["Blake Gentry", "Brandur Leach"] s.email = "brandur@brandur.org" s.files = Dir.glob("lib/**/*") diff --git a/ruby/driver/riverqueue-activerecord/spec/client_spec.rb b/ruby/driver/riverqueue-activerecord/spec/client_spec.rb index cb9586b28..9f2cc47d4 100644 --- a/ruby/driver/riverqueue-activerecord/spec/client_spec.rb +++ b/ruby/driver/riverqueue-activerecord/spec/client_spec.rb @@ -10,7 +10,7 @@ RSpec.describe "ActiveRecord client integration" do [:postgres, :sqlite].each do |adapter| context "with #{adapter}", database: adapter do - before { skip "PostgreSQL unavailable" if adapter == :postgres && !PG_AVAILABLE } + before { skip "Postgres unavailable" if adapter == :postgres && !PG_AVAILABLE } around do |example| if adapter == :postgres && !PG_AVAILABLE @@ -24,16 +24,16 @@ end it_behaves_like "client driver end to end" - it_behaves_like "PostgreSQL state update races" if adapter == :postgres + it_behaves_like "Postgres state update races" if adapter == :postgres it_behaves_like "SQLite corrupt job runtime" if adapter == :sqlite - it_behaves_like "PostgreSQL insert notifications" if adapter == :postgres - it_behaves_like "PostgreSQL cancellation notifications" if adapter == :postgres - it_behaves_like "PostgreSQL leadership notifications" if adapter == :postgres - it_behaves_like "PostgreSQL queue control notifications" if adapter == :postgres + it_behaves_like "Postgres insert notifications" if adapter == :postgres + it_behaves_like "Postgres cancellation notifications" if adapter == :postgres + it_behaves_like "Postgres leadership notifications" if adapter == :postgres + it_behaves_like "Postgres queue control notifications" if adapter == :postgres it_behaves_like "SQLite cancellation notifications" if adapter == :sqlite it_behaves_like "SQL scheduling concurrency" if adapter == :postgres - it_behaves_like "PostgreSQL finalized job list plans" if adapter == :postgres - it_behaves_like "PostgreSQL rescue concurrency" if adapter == :postgres + it_behaves_like "Postgres finalized job list plans" if adapter == :postgres + it_behaves_like "Postgres rescue concurrency" if adapter == :postgres it_behaves_like "dedicated worker process" end end diff --git a/ruby/driver/riverqueue-activerecord/spec/driver_spec.rb b/ruby/driver/riverqueue-activerecord/spec/driver_spec.rb index e20e1f224..124d96abf 100644 --- a/ruby/driver/riverqueue-activerecord/spec/driver_spec.rb +++ b/ruby/driver/riverqueue-activerecord/spec/driver_spec.rb @@ -12,7 +12,7 @@ end { - "PostgreSQL" => {adapter: :postgres, available: PG_AVAILABLE}, + "Postgres" => {adapter: :postgres, available: PG_AVAILABLE}, "SQLite" => {adapter: :sqlite, available: true} }.each do |name, config| next unless config[:available] @@ -66,7 +66,7 @@ expect(insert_res.job.errors).to eq([]) end - it "persists PostgreSQL args as a JSON object rather than a JSON string" do + it "persists Postgres args as a JSON object rather than a JSON string" do next unless config[:adapter] == :postgres insert_res = client.insert(SimpleArgs.new(job_num: 1)) @@ -283,7 +283,7 @@ end end - # PostgreSQL-only: test the raw row conversion used by upsert_all + # Postgres-only: test the raw row conversion used by upsert_all next unless config[:adapter] == :postgres describe "#postgres_to_job_row_from_raw" do diff --git a/ruby/driver/riverqueue-activerecord/spec/migrator_spec.rb b/ruby/driver/riverqueue-activerecord/spec/migrator_spec.rb index 0e2045ee4..b390382bf 100644 --- a/ruby/driver/riverqueue-activerecord/spec/migrator_spec.rb +++ b/ruby/driver/riverqueue-activerecord/spec/migrator_spec.rb @@ -10,7 +10,7 @@ [:postgres, :sqlite].each do |adapter| context "with #{adapter}", database: adapter do around do |example| - skip "PostgreSQL unavailable" if adapter == :postgres && !PG_AVAILABLE + skip "Postgres unavailable" if adapter == :postgres && !PG_AVAILABLE ClientTestDatabase.with_active_record(adapter, migrate: false) do |driver| @driver = driver diff --git a/ruby/driver/riverqueue-activerecord/spec/spec_helper.rb b/ruby/driver/riverqueue-activerecord/spec/spec_helper.rb index a2cf238ef..74d24d4fb 100644 --- a/ruby/driver/riverqueue-activerecord/spec/spec_helper.rb +++ b/ruby/driver/riverqueue-activerecord/spec/spec_helper.rb @@ -14,7 +14,7 @@ rescue => e raise if ENV["CI"] == "true" || ENV["RIVER_REQUIRE_DATABASES"] == "1" - warn "PostgreSQL not available, skipping PostgreSQL tests: #{e.message}" + warn "Postgres not available, skipping Postgres tests: #{e.message}" nil end end diff --git a/ruby/driver/riverqueue-activerecord/spec/yugabyte_spec.rb b/ruby/driver/riverqueue-activerecord/spec/yugabyte_spec.rb index 81c9e7832..e3ac3db05 100644 --- a/ruby/driver/riverqueue-activerecord/spec/yugabyte_spec.rb +++ b/ruby/driver/riverqueue-activerecord/spec/yugabyte_spec.rb @@ -18,8 +18,8 @@ end it_behaves_like "Yugabyte driver compatibility", ENV["YUGABYTE_LISTEN_NOTIFY_ENABLED"] == "1" if ENV["YUGABYTE_LISTEN_NOTIFY_ENABLED"] == "1" - it_behaves_like "PostgreSQL insert notifications" - it_behaves_like "PostgreSQL cancellation notifications" + it_behaves_like "Postgres insert notifications" + it_behaves_like "Postgres cancellation notifications" end elsif PG_AVAILABLE [nil, false, true].each do |notifications| @@ -33,8 +33,8 @@ end it_behaves_like "Yugabyte driver compatibility", notifications if notifications - it_behaves_like "PostgreSQL insert notifications" - it_behaves_like "PostgreSQL cancellation notifications" + it_behaves_like "Postgres insert notifications" + it_behaves_like "Postgres cancellation notifications" end end end diff --git a/ruby/driver/riverqueue-sequel/docs/README.md b/ruby/driver/riverqueue-sequel/docs/README.md index 7afbad883..fe0a76c4e 100644 --- a/ruby/driver/riverqueue-sequel/docs/README.md +++ b/ruby/driver/riverqueue-sequel/docs/README.md @@ -1,6 +1,6 @@ # riverqueue-sequel -[Sequel](https://sequel.jeremyevans.net/) driver for [River](https://github.com/riverqueue/river)'s [`riverqueue` gem for Ruby](https://rubygems.org/gems/riverqueue). PostgreSQL and SQLite are supported. +[Sequel](https://sequel.jeremyevans.net/) driver for [River](https://github.com/riverqueue/river)'s [`riverqueue` gem for Ruby](https://rubygems.org/gems/riverqueue). Postgres and SQLite are supported. Add this driver and only the database adapter used by the application to `Gemfile`. The driver pulls in the core gem: @@ -10,7 +10,7 @@ gem "riverqueue-sequel" gem "pg" # or: gem "sqlite3" ``` -For PostgreSQL, add `pg` to `Gemfile`: +For Postgres, add `pg` to `Gemfile`: ```ruby gem "pg" @@ -38,7 +38,7 @@ client = River::Client.new(River::Driver::Sequel.new(db)) Use current River migrations to create and update the SQLite database. -YugabyteDB is supported through the PostgreSQL adapter, with automatic capability +YugabyteDB is supported through the Postgres adapter, with automatic capability detection. See [YugabyteDB setup and behavior](../../../docs/yugabyte.md). ## Development diff --git a/ruby/driver/riverqueue-sequel/docs/development.md b/ruby/driver/riverqueue-sequel/docs/development.md index c9b88ad9a..953495f57 100644 --- a/ruby/driver/riverqueue-sequel/docs/development.md +++ b/ruby/driver/riverqueue-sequel/docs/development.md @@ -15,7 +15,7 @@ $ createdb river_test Tests migrate their own disposable schemas using the bundled SQL and leave existing tables untouched. The database user needs permission to create and drop -schemas. Set `TEST_DATABASE_URL` to use a different PostgreSQL database. +schemas. Set `TEST_DATABASE_URL` to use a different Postgres database. Generate shared fixtures from the repository root with `make generate/fixtures` before invoking the driver specs directly. diff --git a/ruby/driver/riverqueue-sequel/lib/driver.rb b/ruby/driver/riverqueue-sequel/lib/driver.rb index b6878370a..a2c576e50 100644 --- a/ruby/driver/riverqueue-sequel/lib/driver.rb +++ b/ruby/driver/riverqueue-sequel/lib/driver.rb @@ -3,7 +3,7 @@ require "securerandom" module River::Driver - # Provides a Sequel driver for River supporting PostgreSQL, YugabyteDB, and SQLite. + # Provides a Sequel driver for River supporting Postgres, YugabyteDB, and SQLite. # # Used in conjunction with a River client like: # @@ -18,7 +18,7 @@ module River::Driver class Sequel include River::Driver::Runtime - # Creates a driver backed by a connected Sequel::Database for PostgreSQL or + # Creates a driver backed by a connected Sequel::Database for Postgres or # SQLite. def initialize(db) @db = db diff --git a/ruby/driver/riverqueue-sequel/riverqueue-sequel.gemspec b/ruby/driver/riverqueue-sequel/riverqueue-sequel.gemspec index 8f937d341..2a242b5a4 100644 --- a/ruby/driver/riverqueue-sequel/riverqueue-sequel.gemspec +++ b/ruby/driver/riverqueue-sequel/riverqueue-sequel.gemspec @@ -3,8 +3,8 @@ Gem::Specification.new do |s| s.name = "riverqueue-sequel" s.version = "0.13.0" - s.summary = "Sequel PostgreSQL and SQLite driver for the River Ruby gem." - s.description = "Sequel PostgreSQL and SQLite driver for inserting and working River jobs in Ruby." + s.summary = "Sequel Postgres and SQLite driver for the River Ruby gem." + s.description = "Sequel Postgres and SQLite driver for inserting and working River jobs in Ruby." s.authors = ["Blake Gentry", "Brandur Leach"] s.email = "brandur@brandur.org" s.files = Dir.glob("lib/**/*") diff --git a/ruby/driver/riverqueue-sequel/spec/client_spec.rb b/ruby/driver/riverqueue-sequel/spec/client_spec.rb index 9b6baae6c..17cf40f4a 100644 --- a/ruby/driver/riverqueue-sequel/spec/client_spec.rb +++ b/ruby/driver/riverqueue-sequel/spec/client_spec.rb @@ -10,7 +10,7 @@ RSpec.describe "Sequel client integration" do [:postgres, :sqlite].each do |adapter| context "with #{adapter}", database: adapter do - before { skip "PostgreSQL unavailable" if adapter == :postgres && !DB } + before { skip "Postgres unavailable" if adapter == :postgres && !DB } around do |example| if adapter == :postgres && !DB @@ -24,16 +24,16 @@ end it_behaves_like "client driver end to end" - it_behaves_like "PostgreSQL state update races" if adapter == :postgres + it_behaves_like "Postgres state update races" if adapter == :postgres it_behaves_like "SQLite corrupt job runtime" if adapter == :sqlite - it_behaves_like "PostgreSQL insert notifications" if adapter == :postgres - it_behaves_like "PostgreSQL cancellation notifications" if adapter == :postgres - it_behaves_like "PostgreSQL leadership notifications" if adapter == :postgres - it_behaves_like "PostgreSQL queue control notifications" if adapter == :postgres + it_behaves_like "Postgres insert notifications" if adapter == :postgres + it_behaves_like "Postgres cancellation notifications" if adapter == :postgres + it_behaves_like "Postgres leadership notifications" if adapter == :postgres + it_behaves_like "Postgres queue control notifications" if adapter == :postgres it_behaves_like "SQLite cancellation notifications" if adapter == :sqlite it_behaves_like "SQL scheduling concurrency" if adapter == :postgres - it_behaves_like "PostgreSQL finalized job list plans" if adapter == :postgres - it_behaves_like "PostgreSQL rescue concurrency" if adapter == :postgres + it_behaves_like "Postgres finalized job list plans" if adapter == :postgres + it_behaves_like "Postgres rescue concurrency" if adapter == :postgres it_behaves_like "dedicated worker process" end end diff --git a/ruby/driver/riverqueue-sequel/spec/driver_spec.rb b/ruby/driver/riverqueue-sequel/spec/driver_spec.rb index f9b3b2840..ce1b4ce82 100644 --- a/ruby/driver/riverqueue-sequel/spec/driver_spec.rb +++ b/ruby/driver/riverqueue-sequel/spec/driver_spec.rb @@ -6,7 +6,7 @@ RSpec.describe River::Driver::Sequel do if DB - context "with PostgreSQL", database: :postgres do + context "with Postgres", database: :postgres do around(:each) { |ex| test_transaction(&ex) } let!(:driver) { River::Driver::Sequel.new(DB) } @@ -30,7 +30,7 @@ end end - describe "#to_job_row (PostgreSQL)" do + describe "#to_job_row (Postgres)" do it "converts a database record to `River::JobRow` with minimal properties" do river_job = DB[:river_job].returning.insert_select({ id: 1, diff --git a/ruby/driver/riverqueue-sequel/spec/migrator_spec.rb b/ruby/driver/riverqueue-sequel/spec/migrator_spec.rb index c68b4daab..82fd02d83 100644 --- a/ruby/driver/riverqueue-sequel/spec/migrator_spec.rb +++ b/ruby/driver/riverqueue-sequel/spec/migrator_spec.rb @@ -10,7 +10,7 @@ [:postgres, :sqlite].each do |adapter| context "with #{adapter}", database: adapter do around do |example| - skip "PostgreSQL unavailable" if adapter == :postgres && !DB + skip "Postgres unavailable" if adapter == :postgres && !DB ClientTestDatabase.with_sequel(adapter, migrate: false) do |driver| @driver = driver diff --git a/ruby/driver/riverqueue-sequel/spec/spec_helper.rb b/ruby/driver/riverqueue-sequel/spec/spec_helper.rb index d2c2c4c0a..318fadf8c 100644 --- a/ruby/driver/riverqueue-sequel/spec/spec_helper.rb +++ b/ruby/driver/riverqueue-sequel/spec/spec_helper.rb @@ -13,7 +13,7 @@ rescue => e raise if ENV["CI"] == "true" || ENV["RIVER_REQUIRE_DATABASES"] == "1" - warn "PostgreSQL not available, skipping PostgreSQL tests: #{e.message}" + warn "Postgres not available, skipping Postgres tests: #{e.message}" nil end end @@ -56,7 +56,7 @@ def available_test_transaction(&) elsif SQLITE_DB sqlite_test_transaction(&) else - skip "PostgreSQL and SQLite are unavailable" + skip "Postgres and SQLite are unavailable" end end diff --git a/ruby/driver/riverqueue-sequel/spec/yugabyte_spec.rb b/ruby/driver/riverqueue-sequel/spec/yugabyte_spec.rb index b102be139..95adafa34 100644 --- a/ruby/driver/riverqueue-sequel/spec/yugabyte_spec.rb +++ b/ruby/driver/riverqueue-sequel/spec/yugabyte_spec.rb @@ -18,8 +18,8 @@ end it_behaves_like "Yugabyte driver compatibility", ENV["YUGABYTE_LISTEN_NOTIFY_ENABLED"] == "1" if ENV["YUGABYTE_LISTEN_NOTIFY_ENABLED"] == "1" - it_behaves_like "PostgreSQL insert notifications" - it_behaves_like "PostgreSQL cancellation notifications" + it_behaves_like "Postgres insert notifications" + it_behaves_like "Postgres cancellation notifications" end elsif DB [nil, false, true].each do |notifications| @@ -33,8 +33,8 @@ end it_behaves_like "Yugabyte driver compatibility", notifications if notifications - it_behaves_like "PostgreSQL insert notifications" - it_behaves_like "PostgreSQL cancellation notifications" + it_behaves_like "Postgres insert notifications" + it_behaves_like "Postgres cancellation notifications" end end end diff --git a/ruby/lib/driver/job_row_decoder.rb b/ruby/lib/driver/job_row_decoder.rb index 9bcabaa9c..5e5b02296 100644 --- a/ruby/lib/driver/job_row_decoder.rb +++ b/ruby/lib/driver/job_row_decoder.rb @@ -23,7 +23,7 @@ def self.attempt_error(value) def self.error_time(value) return ZERO_TIME unless value.is_a?(String) - # Keep Ruby's existing acceptance of PostgreSQL-style timestamps too. + # Keep Ruby's existing acceptance of Postgres-style timestamps too. Time.parse(value).utc rescue ArgumentError ZERO_TIME @@ -63,7 +63,7 @@ def json(field, raw, type: nil, strings: false, default: nil) end def decoded(field, value, type: nil, strings: false, default: nil) - # Sequel's PostgreSQL JSON and array wrappers delegate to Ruby values. + # Sequel's Postgres JSON and array wrappers delegate to Ruby values. value = value.__getobj__ if value.respond_to?(:__getobj__) return default if value.nil? diff --git a/ruby/lib/driver/postgres_capabilities.rb b/ruby/lib/driver/postgres_capabilities.rb index 25548ad05..6648677c0 100644 --- a/ruby/lib/driver/postgres_capabilities.rb +++ b/ruby/lib/driver/postgres_capabilities.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module River::Driver - # PostgreSQL-compatible servers differ in conflict detection and notification + # Postgres-compatible servers differ in conflict detection and notification # support. Keep these rules aligned with Go's PostgresCapabilities. class PostgresCapabilities attr_reader :supports_listen_notify, :unique_insert_mode, :unique_insert_sql diff --git a/ruby/lib/driver/runtime.rb b/ruby/lib/driver/runtime.rb index 3e1faced4..93d942981 100644 --- a/ruby/lib/driver/runtime.rb +++ b/ruby/lib/driver/runtime.rb @@ -27,7 +27,7 @@ def postgres_capabilities end # Notifications and rows must commit together. The insertion drivers call - # this inside their transaction; PostgreSQL defers delivery until commit. + # this inside their transaction; Postgres defers delivery until commit. private def postgres_notify_insert(params) queues = params.select { |param| param.state == River::JOB_STATE_AVAILABLE }.map(&:queue).uniq return if queues.empty? @@ -558,7 +558,7 @@ def queue_upsert(name, metadata: {}, now: Time.now.utc) params.map do |param| key = param.unique_key if key && !key.empty? && River::UniqueBitmask.to_states((param.unique_states || "0").to_i(2)).include?(param.state) - # PostgreSQL rejects batches that upsert the same indexed row twice. + # Postgres rejects batches that upsert the same indexed row twice. raise ArgumentError, "unique key appears more than once in batch" if keys[key] keys[key] = true @@ -594,7 +594,7 @@ def queue_upsert(name, metadata: {}, now: Time.now.utc) finalized = params.sort_by == :finalized_at && params.states&.length == 1 && %w[cancelled completed discarded].include?(params.states.first) # Schemas require finalized timestamps for terminal states. Spell this out - # so PostgreSQL can use the partial (state, finalized_at) index. + # so Postgres can use the partial (state, finalized_at) index. clauses << "finalized_at IS NOT NULL" if finalized # Explicit NULLS LAST prevents a backward index scan, even when there are # no nulls. Only request it for timestamps that can actually be null. @@ -626,7 +626,7 @@ def queue_upsert(name, metadata: {}, now: Time.now.utc) if runtime_postgres? "metadata || #{runtime_json(metadata)}" else - # PostgreSQL's || replaces top-level values, including JSON null. + # Postgres's || replaces top-level values, including JSON null. # JSON Merge Patch would recursively merge objects and delete nulls. merged = metadata.reduce("metadata") do |expression, (key, value)| path = runtime_quote("$.#{JSON.generate(key.to_s)}") diff --git a/ruby/lib/job_persisted_logging/plugin.rb b/ruby/lib/job_persisted_logging/plugin.rb index 57cb4d6f3..5034d2381 100644 --- a/ruby/lib/job_persisted_logging/plugin.rb +++ b/ruby/lib/job_persisted_logging/plugin.rb @@ -84,7 +84,7 @@ def finish @mutex.synchronize do @closed = true # Drop invalid/incomplete UTF-8 sequences (including a character cut - # at the byte limit) and NULs, which PostgreSQL JSONB cannot represent. + # at the byte limit) and NULs, which Postgres JSONB cannot represent. [@data.dup.force_encoding(Encoding::UTF_8).scrub("").delete("\0"), @truncated] end end diff --git a/ruby/lib/migrator.rb b/ruby/lib/migrator.rb index 62202317a..a17ddfcdc 100644 --- a/ruby/lib/migrator.rb +++ b/ruby/lib/migrator.rb @@ -9,7 +9,7 @@ class Migrator attr_reader :migrations - # Creates a migrator for an installed River driver. PostgreSQL schemas must + # Creates a migrator for an installed River driver. Postgres schemas must # already exist and use simple SQL identifiers; SQLite uses its main schema. # The optional migrations_path is a root containing backend/line/*.sql. def initialize(driver, line: "main", migrations_path: File.expand_path("../migration", __dir__.to_s), schema: nil) diff --git a/ruby/migration/manifest.json b/ruby/migration/manifest.json index b3c2ff62c..100357042 100644 --- a/ruby/migration/manifest.json +++ b/ruby/migration/manifest.json @@ -12,10 +12,10 @@ "postgresql/main/005_migration_unique_client.up.sql": "b760f487152c7d92102869d46b8a64dc1e2094d5675e690ffbe52a747eee8431", "postgresql/main/006_bulk_unique.down.sql": "726483f6e5aa7dd02cdd974cd7bf716973a8d0a97ba6dbc5dc5304aaf54c7ad7", "postgresql/main/006_bulk_unique.up.sql": "3b133f7ce4662d3dc8bd4a57628e0e116a300b2635a79315557aa1369849f0fb", - "postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql": "9131aae235187dbdaaa822dab2a475a884e917d9af05e3c98fb95c152eaa769a", - "postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql": "47ec8031b88e69004de2def5bc3109d969f71ee4c33a1e7dac2fb8c9dd19182d", - "postgresql/main/008_job_id_autoincrement.down.sql": "0c3750a947d6494db07d56f5d3735a5e49a2cbfa1f7a09771227c31c8147bf70", - "postgresql/main/008_job_id_autoincrement.up.sql": "0c3750a947d6494db07d56f5d3735a5e49a2cbfa1f7a09771227c31c8147bf70", + "postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql": "2771765becc5baa0a8af4406cb4d58ea6d3fb0ebdbf72a0c23ccc72da623caeb", + "postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql": "af01339fcb1687de1f768a570b6ad1e51d23300082aed60440f6a662a0e39d85", + "postgresql/main/008_job_id_autoincrement.down.sql": "678b3b02deb2f798c3fda3a73c974fc1fe48c6b88688b94f0f7700132b30626f", + "postgresql/main/008_job_id_autoincrement.up.sql": "678b3b02deb2f798c3fda3a73c974fc1fe48c6b88688b94f0f7700132b30626f", "sqlite/main/001_create_river_migration.down.sql": "34c87dc594bf7520bc3ae69f6f0da8d2d9a472616ab38b37e63d4e3838da06d2", "sqlite/main/001_create_river_migration.up.sql": "d15597cb0bb884fb0727d2a29ad8313842708b55fd561a5fe62e37aad5f34298", "sqlite/main/002_initial_schema.down.sql": "900508ba08d0ca3c8451eb2854cd9ab837166ef55736393524253b6228438470", @@ -31,7 +31,7 @@ "sqlite/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql": "55bffeb528b40dffc0cbec2f22d1463aef37a8b3d7977f83729cc505bb77c745", "sqlite/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql": "441a05e1d9aa4f151877ccf725b0b0a86f27013442297d4b621c05676270d0b0", "sqlite/main/008_job_id_autoincrement.down.sql": "04871283fe5d4cab4ac70da28d8509aa7ba765994d528c2dcc7ebe0ee596710c", - "sqlite/main/008_job_id_autoincrement.up.sql": "049c9bf615f24a326bcc31ddc87b46f76e3de11e3eea3b2b9e1358131b3f3bed" + "sqlite/main/008_job_id_autoincrement.up.sql": "3ce6d941f4c434adbd87e69089fa5e99b6047e5b51e611c9845e1d0d3c080e0f" }, "source": "riverdriver/" } diff --git a/ruby/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql b/ruby/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql index bed717f87..9dd01264c 100644 --- a/ruby/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql +++ b/ruby/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql @@ -47,7 +47,7 @@ ALTER TABLE /* TEMPLATE: schema */river_queue -- -- SQLite JSONB conversion rollback. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- Notification outbox rollback. diff --git a/ruby/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql b/ruby/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql index 39e3249c9..41fabc912 100644 --- a/ruby/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql +++ b/ruby/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql @@ -16,7 +16,7 @@ CREATE INDEX river_notification_topic_id_idx ON /* TEMPLATE: schema */river_noti -- -- SQLite JSONB conversion. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- SQL cleanup. diff --git a/ruby/migration/postgresql/main/008_job_id_autoincrement.down.sql b/ruby/migration/postgresql/main/008_job_id_autoincrement.down.sql index 695357bb8..0bad60286 100644 --- a/ruby/migration/postgresql/main/008_job_id_autoincrement.down.sql +++ b/ruby/migration/postgresql/main/008_job_id_autoincrement.down.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/ruby/migration/postgresql/main/008_job_id_autoincrement.up.sql b/ruby/migration/postgresql/main/008_job_id_autoincrement.up.sql index 695357bb8..0bad60286 100644 --- a/ruby/migration/postgresql/main/008_job_id_autoincrement.up.sql +++ b/ruby/migration/postgresql/main/008_job_id_autoincrement.up.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/ruby/migration/sqlite/main/008_job_id_autoincrement.up.sql b/ruby/migration/sqlite/main/008_job_id_autoincrement.up.sql index c7de15deb..6ee4b32c7 100644 --- a/ruby/migration/sqlite/main/008_job_id_autoincrement.up.sql +++ b/ruby/migration/sqlite/main/008_job_id_autoincrement.up.sql @@ -1,5 +1,5 @@ -- Rebuild river_job so automatically generated IDs are never reused after the --- job holding the largest ID is deleted. Unlike PostgreSQL sequences, SQLite's +-- job holding the largest ID is deleted. Unlike Postgres sequences, SQLite's -- default ROWID allocator may otherwise reuse that deleted ID. -- Rebuilding river_job would discard schema installed by River Pro. Check diff --git a/ruby/rails/riverqueue-rails/README.md b/ruby/rails/riverqueue-rails/README.md index 5f878506d..2b4c895ae 100644 --- a/ruby/rails/riverqueue-rails/README.md +++ b/ruby/rails/riverqueue-rails/README.md @@ -1,6 +1,6 @@ # River for Rails -`riverqueue-rails` integrates Active Job with River's existing PostgreSQL/SQLite +`riverqueue-rails` integrates Active Job with River's existing Postgres/SQLite runtime. It supports Rails 7.2, 8.0, and 8.1 and lives separately from the Rails-independent core gem. Database gems remain application-selected. @@ -183,8 +183,8 @@ worker/plugin registrations or periodic configuration; these retain Ruby objects Keep Rails' `:test` adapter and `ActiveJob::TestHelper` for ordinary application tests. Use `:river` and a migrated isolated database for persistence/runtime integration tests. Disable transactional fixtures for threaded worker tests. -The repository's `make test` includes this gem's PostgreSQL and SQLite tests. -`RIVER_REQUIRE_DATABASES=1 make test` makes missing PostgreSQL an error. +The repository's `make test` includes this gem's Postgres and SQLite tests. +`RIVER_REQUIRE_DATABASES=1 make test` makes missing Postgres an error. Outside a Rails app, instantiate `ActiveJob::QueueAdapters::RiverAdapter.new(client:)` and register `River::Rails::Worker` on your consuming River client. Rails-specific diff --git a/ruby/rails/riverqueue-rails/spec/integration_spec.rb b/ruby/rails/riverqueue-rails/spec/integration_spec.rb index 6e8ae0717..257e65fa3 100644 --- a/ruby/rails/riverqueue-rails/spec/integration_spec.rb +++ b/ruby/rails/riverqueue-rails/spec/integration_spec.rb @@ -85,7 +85,7 @@ def receipt rescue PG::Error => error raise if ENV["CI"] == "true" || ENV["RIVER_REQUIRE_DATABASES"] == "1" - warn "Skipping Rails PostgreSQL tests: #{error.message}" + warn "Skipping Rails Postgres tests: #{error.message}" end end diff --git a/ruby/riverqueue.gemspec b/ruby/riverqueue.gemspec index 340da6294..25b60a55c 100644 --- a/ruby/riverqueue.gemspec +++ b/ruby/riverqueue.gemspec @@ -3,7 +3,7 @@ Gem::Specification.new do |s| s.name = "riverqueue" s.version = "0.13.0" - s.summary = "A fast, reliable job queue for Ruby backed by PostgreSQL or SQLite." + s.summary = "A fast, reliable job queue for Ruby backed by Postgres or SQLite." s.description = "Insert and work River jobs in Ruby using the same schema and state machine as River's Go client. Use with riverqueue-activerecord or riverqueue-sequel." s.authors = ["Blake Gentry", "Brandur Leach"] s.email = "brandur@brandur.org" diff --git a/ruby/spec/client_driver_shared_examples.rb b/ruby/spec/client_driver_shared_examples.rb index eb4cb286b..b94077329 100644 --- a/ruby/spec/client_driver_shared_examples.rb +++ b/ruby/spec/client_driver_shared_examples.rb @@ -5,7 +5,7 @@ require_relative "runtime_draining_shared_examples" require_relative "runtime_finishing_shared_examples" -RSpec.shared_examples "PostgreSQL state update races" do +RSpec.shared_examples "Postgres state update races" do it "skips a concurrent retry when selecting jobs for bulk deletion" do client = River::Client.new(@driver) first, second = 2.times.map do @@ -141,7 +141,7 @@ end end -RSpec.shared_examples "PostgreSQL finalized job list plans" do +RSpec.shared_examples "Postgres finalized job list plans" do it "uses the finalized-time index for single-state listings in both directions" do @driver.send(:runtime_execute, <<~SQL) INSERT INTO river_job (state, kind, args, finalized_at) @@ -165,7 +165,7 @@ end end -RSpec.shared_examples "PostgreSQL rescue concurrency" do +RSpec.shared_examples "Postgres rescue concurrency" do [:complete, :reclaim].each do |change| it "preserves a concurrent #{change} and rescues another stuck job in the batch" do now = Time.now.utc diff --git a/ruby/spec/conformance_spec.rb b/ruby/spec/conformance_spec.rb index b2b40ce93..918c1b967 100644 --- a/ruby/spec/conformance_spec.rb +++ b/ruby/spec/conformance_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" # The fixture-backed checks run once, alongside SQLite, without a Go setup in -# every PostgreSQL matrix entry. +# every Postgres matrix entry. return unless RiverTestDatabase.enabled?(:sqlite) require_relative "support/conformance_fixtures" require_relative "support/river_test_schema" @@ -132,7 +132,7 @@ class ConformanceRecord < ActiveRecord::Base end # These exercise actual insertion/cancellation and the SQL outbox in both - # drivers without requiring a server. PostgreSQL delivery/commit ordering is + # drivers without requiring a server. Postgres delivery/commit ordering is # separately exercised by the shared driver specs. %w[activerecord sequel].each do |adapter| context "#{adapter} persisted protocol" do diff --git a/ruby/spec/driver_runtime_feature_spec.rb b/ruby/spec/driver_runtime_feature_spec.rb index 4b3e3eec1..869a64101 100644 --- a/ruby/spec/driver_runtime_feature_spec.rb +++ b/ruby/spec/driver_runtime_feature_spec.rb @@ -30,7 +30,7 @@ let(:sqlite_driver) { River::Driver::Sequel.new(SQLITE_DB) } - it "does not issue PostgreSQL notifications when Yugabyte disables them" do + it "does not issue Postgres notifications when Yugabyte disables them" do capabilities = River::Driver::PostgresCapabilities.new(product: "YugabyteDB", version_num: 150_012, yb_listen_notify_enabled: false) postgres_driver.define_singleton_method(:postgres_capabilities) { capabilities } postgres_driver.define_singleton_method(:runtime_execute) { |_sql| raise "unexpected notification" } @@ -41,7 +41,7 @@ expect { postgres_driver.send(:runtime_notify, "river_control", {action: "cancel"}) }.not_to raise_error end - it "does not use the SQLite notification cleaner on PostgreSQL" do + it "does not use the SQLite notification cleaner on Postgres" do expect(postgres_driver.notification_delete_before(horizon: Time.now.utc)).to eq(0) end @@ -64,7 +64,7 @@ expect(driver.job_list(:all)).to equal(expected) end - it "builds PostgreSQL claim SQL with row locking and array history" do + it "builds Postgres claim SQL with row locking and array history" do sql = nil driver = Object.new.extend(River::Driver::Runtime) driver.define_singleton_method(:runtime_postgres?) { true } @@ -114,7 +114,7 @@ expect(errors).to include("7") end - it "renders every shared PostgreSQL-specific SQL value" do + it "renders every shared Postgres-specific SQL value" do expect(postgres_driver.send(:runtime_tag_contains, "tag")).to include("tags @>") expect(postgres_driver.send(:runtime_metadata_equals, :tenant, 7)).to include("metadata ->", "::jsonb") expect(postgres_driver.send(:runtime_state, River::JOB_STATE_AVAILABLE)).to end_with("::river_job_state") @@ -126,7 +126,7 @@ expect(postgres_driver.send(:runtime_queue_columns)).to eq("name, created_at, metadata, paused_at, updated_at") end - it "accepts already-decoded JSON and Time values from PostgreSQL adapters" do + it "accepts already-decoded JSON and Time values from Postgres adapters" do metadata = {"ready" => true} time = Time.utc(2026, 1, 2, 3, 4, 5) diff --git a/ruby/spec/driver_runtime_shared_examples.rb b/ruby/spec/driver_runtime_shared_examples.rb index 72bf178de..058f54ce4 100644 --- a/ruby/spec/driver_runtime_shared_examples.rb +++ b/ruby/spec/driver_runtime_shared_examples.rb @@ -21,7 +21,7 @@ def to_json = JSON.dump(value: @value) driver.job_claim(id: inserted.id, attempted_by: "worker", now: now - 120) expect(driver.job_rescue_stuck(horizon: now - 60, now: now, retry_policy: River::DefaultClientRetryPolicy.new)).to eq(1) - # PostgreSQL expands the exponent into an exact integer; SQLite retains it + # Postgres expands the exponent into an exact integer; SQLite retains it # as a floating-point value that Ruby decodes as infinity. expected = driver.send(:runtime_postgres?) ? 10**999 + 1 : 1 expect(client.job_get(inserted.id)).to have_attributes(state: "retryable", metadata: include("river:rescue_count" => expected)) diff --git a/ruby/spec/insert_notification_shared_examples.rb b/ruby/spec/insert_notification_shared_examples.rb index 1d69efd5c..2ac9fce40 100644 --- a/ruby/spec/insert_notification_shared_examples.rb +++ b/ruby/spec/insert_notification_shared_examples.rb @@ -3,7 +3,7 @@ require "pg" require_relative "support/conformance_fixtures" -shared_context "PostgreSQL notification listener" do |topic| +shared_context "Postgres notification listener" do |topic| around do |example| @insert_listener = PG.connect(ENV["TEST_DATABASE_URL"] || "postgres://localhost/river_test") row = @driver.send(:runtime_query_rows, "SELECT current_schema() AS name").first @@ -32,8 +32,8 @@ def insert_notifications end end -shared_examples "PostgreSQL insert notifications" do - include_context "PostgreSQL notification listener", "river_insert" +shared_examples "Postgres insert notifications" do + include_context "Postgres notification listener", "river_insert" it "notifies each available queue once and delivers only after the caller commits" do client = River::Client.new(@driver) @@ -67,8 +67,8 @@ def insert_notifications end end -shared_examples "PostgreSQL cancellation notifications" do - include_context "PostgreSQL notification listener", "river_control" +shared_examples "Postgres cancellation notifications" do + include_context "Postgres notification listener", "river_control" it "publishes Go-compatible cancellation only when the transaction commits" do client = River::Client.new(@driver) @@ -145,8 +145,8 @@ def cancellation_notifications end end -shared_examples "PostgreSQL queue control notifications" do - include_context "PostgreSQL notification listener", "river_control" +shared_examples "Postgres queue control notifications" do + include_context "Postgres notification listener", "river_control" it "publishes Go's pause, resume, and metadata payloads only after commit" do @driver.queue_upsert("priority") @@ -188,8 +188,8 @@ def cancellation_notifications end end -shared_examples "PostgreSQL leadership notifications" do - include_context "PostgreSQL notification listener", "river_leadership" +shared_examples "Postgres leadership notifications" do + include_context "Postgres notification listener", "river_leadership" it "broadcasts Go's resignation payload only when the leader's deletion commits" do @driver.leader_acquire("client-1") diff --git a/ruby/spec/migrator_spec.rb b/ruby/spec/migrator_spec.rb index 95b73d511..489a2562c 100644 --- a/ruby/spec/migrator_spec.rb +++ b/ruby/spec/migrator_spec.rb @@ -32,7 +32,7 @@ [:postgres, :sqlite].each do |adapter| context "with #{adapter}", database: adapter do around do |example| - skip "PostgreSQL unavailable" if adapter == :postgres && !DB + skip "Postgres unavailable" if adapter == :postgres && !DB ClientTestDatabase.with_sequel(adapter, migrate: false) do |driver| @driver = driver diff --git a/ruby/spec/support/client_test_database.rb b/ruby/spec/support/client_test_database.rb index 49cb9bc44..d7b58fedf 100644 --- a/ruby/spec/support/client_test_database.rb +++ b/ruby/spec/support/client_test_database.rb @@ -17,7 +17,7 @@ def self.with_active_record(adapter, migrate: true, pg_catalog_last: false) search_path = pg_catalog_last ? "#{schema},pg_catalog" : "#{schema},public" ActiveRecord::Base.establish_connection(config.merge(pool: 20, schema_search_path: search_path)) # Create and drop through the test pool to avoid opening separate admin - # connections for every example. PostgreSQL permits a not-yet-created + # connections for every example. Postgres permits a not-yet-created # schema in search_path. ActiveRecord::Base.connection.execute("CREATE SCHEMA #{schema}") schema_created = true diff --git a/ruby/spec/support/river_test_schema.rb b/ruby/spec/support/river_test_schema.rb index 0ade9ce41..8a3388125 100644 --- a/ruby/spec/support/river_test_schema.rb +++ b/ruby/spec/support/river_test_schema.rb @@ -7,7 +7,7 @@ module RiverTestSchema def self.load(driver) migrations = River::Migrator.new(driver).migrations sql = migrations.map do |migration| - # PostgreSQL must commit new enum values before later migrations use them. + # Postgres must commit new enum values before later migrations use them. "BEGIN;\n#{migration.sql_up}\n;COMMIT;" end.join("\n") versions = migrations.map { |migration| "('main', #{migration.version})" }.join(", ") diff --git a/ruby/spec/support/yugabyte_test_database.rb b/ruby/spec/support/yugabyte_test_database.rb index acecb5d51..65926d78e 100644 --- a/ruby/spec/support/yugabyte_test_database.rb +++ b/ruby/spec/support/yugabyte_test_database.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Like Go's DBPoolWithYugabyteVersion, this exercises product/setting detection -# on PostgreSQL, not Yugabyte's storage or transaction semantics. The caller must +# on Postgres, not Yugabyte's storage or transaction semantics. The caller must # own an isolated schema and put it ahead of pg_catalog in every connection's # search_path. An unavailable pg_notify deliberately raises instead of no-oping. module YugabyteTestDatabase diff --git a/ruby/spec/test_schema_spec.rb b/ruby/spec/test_schema_spec.rb index 7ddf1d31a..00e688233 100644 --- a/ruby/spec/test_schema_spec.rb +++ b/ruby/spec/test_schema_spec.rb @@ -8,7 +8,7 @@ [:postgres, :sqlite].each do |adapter| context "with #{adapter}", database: adapter do around do |example| - skip "PostgreSQL unavailable" if adapter == :postgres && !DB + skip "Postgres unavailable" if adapter == :postgres && !DB ClientTestDatabase.with_sequel(adapter, migrate: false) do |driver| @driver = driver diff --git a/rust/CHANGELOG.md b/rust/CHANGELOG.md index 08694f302..37491941a 100644 --- a/rust/CHANGELOG.md +++ b/rust/CHANGELOG.md @@ -26,4 +26,4 @@ Changes to River for Go are recorded in the [repository changelog](../CHANGELOG. ### Added -- First release of River for Rust. `riverqueue` provides a typed, Tokio-based client for PostgreSQL (through SQLx) and SQLite that shares River's database schema and job protocol with River for Go, so Rust and Go clients can insert and work jobs in the same database. It includes typed workers, transactional inserts and completion, unique, scheduled, periodic, and resumable jobs, queue management, job cancellation, events, hooks, middleware, leader election, and maintenance services. Companion crates provide `#[derive(JobArgs)]` with unique options (`riverqueue-macros`), migration application and validation using Go's migration history (`riverqueue-migrate`), the `riverqueue` command for migrations and benchmarks (`riverqueue-cli`), and fixtures, insertion assertions, and worker test helpers (`riverqueue-test`). Requests run with `.tx(...)` use the caller's transaction directly, without a savepoint or nested transaction, like River for Go's `*Tx` methods. Errors may leave partial writes, so roll back the transaction or create an explicit savepoint around the request. [PR #1442](https://github.com/riverqueue/river/pull/1442). +- First release of River for Rust. `riverqueue` provides a typed, Tokio-based client for Postgres (through SQLx) and SQLite that shares River's database schema and job protocol with River for Go, so Rust and Go clients can insert and work jobs in the same database. It includes typed workers, transactional inserts and completion, unique, scheduled, periodic, and resumable jobs, queue management, job cancellation, events, hooks, middleware, leader election, and maintenance services. Companion crates provide `#[derive(JobArgs)]` with unique options (`riverqueue-macros`), migration application and validation using Go's migration history (`riverqueue-migrate`), the `riverqueue` command for migrations and benchmarks (`riverqueue-cli`), and fixtures, insertion assertions, and worker test helpers (`riverqueue-test`). Requests run with `.tx(...)` use the caller's transaction directly, without a savepoint or nested transaction, like River for Go's `*Tx` methods. Errors may leave partial writes, so roll back the transaction or create an explicit savepoint around the request. [PR #1442](https://github.com/riverqueue/river/pull/1442). diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 496022456..c9fe3dd3d 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,7 +38,7 @@ tracing = "0.1.44" [workspace.lints.rust] missing_debug_implementations = "warn" unsafe_code = "forbid" -# `--cfg river_postgres_tests` builds the PostgreSQL integration tests, which +# `--cfg river_postgres_tests` builds the Postgres integration tests, which # need `RIVER_RUST_DATABASE_URL`; `make test/rust` sets it when the URL is set. unexpected_cfgs = { level = "warn", check-cfg = ["cfg(river_postgres_tests)"] } diff --git a/rust/README.md b/rust/README.md index 5f4e3a7c2..6843bd8ed 100644 --- a/rust/README.md +++ b/rust/README.md @@ -1,6 +1,6 @@ # River for Rust -This workspace contains River's Rust implementation. It shares River's database schema and job protocol with River for Go on PostgreSQL and SQLite, with an API designed for Rust and Tokio. The Rust crates are versioned independently of River for Go. +This workspace contains River's Rust implementation. It shares River's database schema and job protocol with River for Go on Postgres and SQLite, with an API designed for Rust and Tokio. The Rust crates are versioned independently of River for Go. ## Workspace crates @@ -14,7 +14,7 @@ This workspace contains River's Rust implementation. It shares River's database The API uses a caller-owned SQLx pool, Tokio, typed workers, and `CancellationToken`. `Client` isn't generic over the database: it accepts a -PostgreSQL or SQLite pool, and there's no driver trait to implement. +Postgres or SQLite pool, and there's no driver trait to implement. ## Quick start @@ -51,7 +51,7 @@ custom schemas, tunable worker/pool/batch sizes, periodic jobs/sec output, and a final jobs/sec plus p95 end-to-end latency summary. Use `riverqueue bench --help` for all options. -PostgreSQL integration tests require a disposable database. They build only +Postgres integration tests require a disposable database. They build only with `--cfg river_postgres_tests`, which the Makefile targets pass to rustc and rustdoc, building into `target/postgres-tests`: @@ -61,7 +61,7 @@ RIVER_RUST_DATABASE_URL=postgres://localhost/river_rust_test \ ``` CI runs unit, doc, and SQLite tests on each supported Rust version, and -PostgreSQL tests against versions 14 through 18. Rust tests check unique +Postgres tests against versions 14 through 18. Rust tests check unique keys, retry bounds, cron schedules, and snooze counts against fixtures that River's Go implementation generates into `conformance/testdata`, which isn't committed. The `make test/rust` targets generate them first, so Go is needed diff --git a/rust/riverqueue-cli/src/bench.rs b/rust/riverqueue-cli/src/bench.rs index ed5c40970..c4d875811 100644 --- a/rust/riverqueue-cli/src/bench.rs +++ b/rust/riverqueue-cli/src/bench.rs @@ -39,7 +39,7 @@ then inserts and works no-op jobs while reporting rough throughput and p95 end-to-end latency. Use only a disposable development or benchmark database. Options: - --database-url URL PostgreSQL URL (or set DATABASE_URL) + --database-url URL Postgres URL (or set DATABASE_URL) --schema NAME River schema (default: current schema) --duration DURATION Stop after a Go-style duration such as 30s or 5m -n, --num-total-jobs COUNT Insert COUNT jobs, then work them all diff --git a/rust/riverqueue-cli/src/main.rs b/rust/riverqueue-cli/src/main.rs index d132d422c..2546726db 100644 --- a/rust/riverqueue-cli/src/main.rs +++ b/rust/riverqueue-cli/src/main.rs @@ -1,6 +1,6 @@ //! River's Rust command-line interface. //! -//! Runs River migrations against PostgreSQL or SQLite and benchmarks the +//! Runs River migrations against Postgres or SQLite and benchmarks the //! worker runtime: //! //! ```text diff --git a/rust/riverqueue-cli/src/migrate.rs b/rust/riverqueue-cli/src/migrate.rs index 4161425cc..07f11ee8c 100644 --- a/rust/riverqueue-cli/src/migrate.rs +++ b/rust/riverqueue-cli/src/migrate.rs @@ -83,7 +83,7 @@ pub(crate) async fn run( #[cfg(feature = "sqlite")] { if args.schema.is_some() { - return Err("--schema is only supported for PostgreSQL".into()); + return Err("--schema is only supported for Postgres".into()); } CommandMigrator::Sqlite(SqliteMigrator::new( SqlitePool::connect(&args.database_url).await?, @@ -91,7 +91,7 @@ pub(crate) async fn run( } } else { #[cfg(not(feature = "postgres"))] - return Err("PostgreSQL support requires the `postgres` feature".into()); + return Err("Postgres support requires the `postgres` feature".into()); #[cfg(feature = "postgres")] { let pool = PgPool::connect(&args.database_url).await?; diff --git a/rust/riverqueue-migrate/Cargo.toml b/rust/riverqueue-migrate/Cargo.toml index 361e5071a..3bfe0a1cf 100644 --- a/rust/riverqueue-migrate/Cargo.toml +++ b/rust/riverqueue-migrate/Cargo.toml @@ -41,7 +41,7 @@ required-features = ["sqlite"] [dev-dependencies] serde_json.workspace = true -# The PostgreSQL tests decode schema snapshots as JSON. +# The Postgres tests decode schema snapshots as JSON. sqlx = { workspace = true, features = ["json"] } tokio = { workspace = true, features = ["rt-multi-thread"] } diff --git a/rust/riverqueue-migrate/README.md b/rust/riverqueue-migrate/README.md index 83307ef3c..ecf42b1b7 100644 --- a/rust/riverqueue-migrate/README.md +++ b/rust/riverqueue-migrate/README.md @@ -1,11 +1,11 @@ # riverqueue-migrate -River's PostgreSQL and SQLite migrations for Rust, identical to the ones River +River's Postgres and SQLite migrations for Rust, identical to the ones River for Go applies, so either language can migrate a database the other uses. The `riverqueue` command from the `riverqueue-cli` crate runs the same migrations from a shell. -Use `PostgresMigrator` for PostgreSQL and `SqliteMigrator` for SQLite: +Use `PostgresMigrator` for Postgres and `SqliteMigrator` for SQLite: ```rust,no_run use riverqueue_migrate::{Direction, MigrateOpts, PostgresMigrator, SqliteMigrator}; diff --git a/rust/riverqueue-migrate/migrations/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql b/rust/riverqueue-migrate/migrations/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql index bed717f87..9dd01264c 100644 --- a/rust/riverqueue-migrate/migrations/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql +++ b/rust/riverqueue-migrate/migrations/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql @@ -47,7 +47,7 @@ ALTER TABLE /* TEMPLATE: schema */river_queue -- -- SQLite JSONB conversion rollback. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- Notification outbox rollback. diff --git a/rust/riverqueue-migrate/migrations/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql b/rust/riverqueue-migrate/migrations/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql index 39e3249c9..41fabc912 100644 --- a/rust/riverqueue-migrate/migrations/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql +++ b/rust/riverqueue-migrate/migrations/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql @@ -16,7 +16,7 @@ CREATE INDEX river_notification_topic_id_idx ON /* TEMPLATE: schema */river_noti -- -- SQLite JSONB conversion. -- --- No-op. PostgreSQL already stores River JSON columns as jsonb. +-- No-op. Postgres already stores River JSON columns as jsonb. -- -- SQL cleanup. diff --git a/rust/riverqueue-migrate/migrations/main/008_job_id_autoincrement.down.sql b/rust/riverqueue-migrate/migrations/main/008_job_id_autoincrement.down.sql index 695357bb8..0bad60286 100644 --- a/rust/riverqueue-migrate/migrations/main/008_job_id_autoincrement.down.sql +++ b/rust/riverqueue-migrate/migrations/main/008_job_id_autoincrement.down.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/rust/riverqueue-migrate/migrations/main/008_job_id_autoincrement.up.sql b/rust/riverqueue-migrate/migrations/main/008_job_id_autoincrement.up.sql index 695357bb8..0bad60286 100644 --- a/rust/riverqueue-migrate/migrations/main/008_job_id_autoincrement.up.sql +++ b/rust/riverqueue-migrate/migrations/main/008_job_id_autoincrement.up.sql @@ -1,3 +1,3 @@ --- No-op. PostgreSQL sequences already prevent automatically generated job IDs +-- No-op. Postgres sequences already prevent automatically generated job IDs -- from being reused. SELECT 1; diff --git a/rust/riverqueue-migrate/migrations/sqlite/main/008_job_id_autoincrement.up.sql b/rust/riverqueue-migrate/migrations/sqlite/main/008_job_id_autoincrement.up.sql index c7de15deb..6ee4b32c7 100644 --- a/rust/riverqueue-migrate/migrations/sqlite/main/008_job_id_autoincrement.up.sql +++ b/rust/riverqueue-migrate/migrations/sqlite/main/008_job_id_autoincrement.up.sql @@ -1,5 +1,5 @@ -- Rebuild river_job so automatically generated IDs are never reused after the --- job holding the largest ID is deleted. Unlike PostgreSQL sequences, SQLite's +-- job holding the largest ID is deleted. Unlike Postgres sequences, SQLite's -- default ROWID allocator may otherwise reuse that deleted ID. -- Rebuilding river_job would discard schema installed by River Pro. Check diff --git a/rust/riverqueue-migrate/src/lib.rs b/rust/riverqueue-migrate/src/lib.rs index 497e26de0..912431fa8 100644 --- a/rust/riverqueue-migrate/src/lib.rs +++ b/rust/riverqueue-migrate/src/lib.rs @@ -6,7 +6,7 @@ )] #![cfg_attr( not(all(feature = "postgres", feature = "sqlite")), - doc = "River's PostgreSQL and SQLite migrations for Rust. The full crate documentation, \ + doc = "River's Postgres and SQLite migrations for Rust. The full crate documentation, \ from the README, builds with both the `postgres` and `sqlite` features, as on \ [docs.rs](https://docs.rs/riverqueue-migrate)." )] @@ -195,7 +195,7 @@ impl std::fmt::Display for ValidateResult { } } -/// Canonical PostgreSQL migration bundle. +/// Canonical Postgres migration bundle. #[cfg(feature = "postgres")] pub const POSTGRES_MIGRATIONS: [Migration; 8] = [ migration!(1, "create_river_migration", "001_create_river_migration"), @@ -246,7 +246,7 @@ pub enum Error { }, } -/// Applies and validates River's PostgreSQL migration history. +/// Applies and validates River's Postgres migration history. #[cfg(feature = "postgres")] #[derive(Clone, Debug)] pub struct PostgresMigrator { @@ -262,7 +262,7 @@ impl PostgresMigrator { &POSTGRES_MIGRATIONS } - /// Creates a migrator for PostgreSQL's current schema. + /// Creates a migrator for Postgres's current schema. #[must_use] pub fn new(pool: PgPool) -> Self { Self { diff --git a/rust/riverqueue-migrate/src/schema.rs b/rust/riverqueue-migrate/src/schema.rs index 92c4cd6ef..f512a4f9b 100644 --- a/rust/riverqueue-migrate/src/schema.rs +++ b/rust/riverqueue-migrate/src/schema.rs @@ -1,10 +1,10 @@ -//! PostgreSQL schema names. +//! Postgres schema names. use std::fmt; use thiserror::Error; -/// PostgreSQL's maximum identifier length. +/// Postgres's maximum identifier length. const POSTGRES_IDENTIFIER_MAX: usize = 63; /// Longest River notification topic, which a schema name must leave room for. @@ -14,7 +14,7 @@ const NOTIFICATION_TOPIC_LONGEST: &str = "river_leadership"; /// notification channels. pub const SCHEMA_MAX_LEN: usize = POSTGRES_IDENTIFIER_MAX - NOTIFICATION_TOPIC_LONGEST.len() - 1; -/// The PostgreSQL schema River's tables live in. +/// The Postgres schema River's tables live in. /// /// [`SchemaName::current`] uses the connection's current schema (normally /// `public`, following `search_path`). An explicit schema is quoted wherever @@ -33,7 +33,7 @@ pub const SCHEMA_MAX_LEN: usize = POSTGRES_IDENTIFIER_MAX - NOTIFICATION_TOPIC_L pub struct SchemaName(Option); impl SchemaName { - /// Uses PostgreSQL's current schema. + /// Uses Postgres's current schema. #[must_use] pub const fn current() -> Self { Self(None) @@ -44,7 +44,7 @@ impl SchemaName { /// Any name is accepted and quoted when rendered, including mixed case /// and punctuation such as /// `river-prod`. Names containing NUL are rejected, as are names too long - /// to prefix River's notification topics within PostgreSQL's identifier + /// to prefix River's notification topics within Postgres's identifier /// limit. /// /// # Errors @@ -84,7 +84,7 @@ impl SchemaName { } } - /// Returns the explicit schema quoted as a PostgreSQL identifier, for + /// Returns the explicit schema quoted as a Postgres identifier, for /// SQL that names the schema itself, or `None` for the connection's /// current schema. #[must_use] @@ -92,7 +92,7 @@ impl SchemaName { self.0.as_deref().map(quote_identifier) } - /// Prefix used by River's canonical PostgreSQL migration templates. + /// Prefix used by River's canonical Postgres migration templates. #[cfg(feature = "postgres")] pub(crate) fn migration_prefix(&self) -> String { self.quoted_identifier() @@ -100,7 +100,7 @@ impl SchemaName { } } -/// Quotes a PostgreSQL identifier, doubling embedded quotes like Go's +/// Quotes a Postgres identifier, doubling embedded quotes like Go's /// `dbutil.SafeIdentifier`. fn quote_identifier(identifier: &str) -> String { format!("\"{}\"", identifier.replace('"', "\"\"")) @@ -122,7 +122,7 @@ impl fmt::Display for SchemaName { #[derive(Debug, Error)] #[non_exhaustive] pub enum SchemaNameError { - /// Schema contains a NUL character, which PostgreSQL identifiers cannot. + /// Schema contains a NUL character, which Postgres identifiers cannot. #[error("schema name cannot contain NUL: {0:?}")] Invalid(String), diff --git a/rust/riverqueue/README.md b/rust/riverqueue/README.md index 8de3d7a71..671b4d20c 100644 --- a/rust/riverqueue/README.md +++ b/rust/riverqueue/README.md @@ -1,7 +1,7 @@ # riverqueue `riverqueue` is the Rust and Tokio client for [River](https://riverqueue.com), -a fast and reliable background job system backed by PostgreSQL or SQLite. It +a fast and reliable background job system backed by Postgres or SQLite. It shares River's database schema and job protocol with River for Go, so Rust and Go services can insert and work jobs in the same database. @@ -23,7 +23,7 @@ Rust version is 1.95. | Feature | Default | Enables | |---|---|---| -| `postgres` | yes | PostgreSQL through SQLx | +| `postgres` | yes | Postgres through SQLx | | `sqlite` | no | SQLite 3.45 or newer through SQLx | | `chrono-tz` | no | IANA zone names such as `America/New_York` in cron `CRON_TZ=` and `TZ=` prefixes | @@ -268,7 +268,7 @@ results are persisted, and independent jobs have no global completion order. One client at a time holds a database lease and runs the leader-owned services: the job scheduler, the stuck-job rescuer, the job and queue cleaners, -the periodic job enqueuer, the PostgreSQL reindexer, and the SQLite +the periodic job enqueuer, the Postgres reindexer, and the SQLite notification cleaner. Losing the lease or stopping the client stops them immediately. @@ -332,7 +332,7 @@ async fn sqlite_client() -> Result> { - [`queue`] and [`query`]: queue records and job list filters and cursors. - [`periodic`]: schedules and runtime periodic job registration. - [`extension`]: hooks, middleware, policies, and metrics. -- [`database`]: PostgreSQL and SQLite database options, and the transactions +- [`database`]: Postgres and SQLite database options, and the transactions River's `.tx` methods accept. - [`error`]: structured errors that keep their sources. - [`protocol`]: wire values such as notification topics and unique keys, for @@ -352,7 +352,7 @@ are explicit, as in `ClientBuilder::without_job_timeout` and The crate's `examples` directory has runnable programs for a basic worker, graceful shutdown, cancellation, transactional enqueueing and completion, -unique and periodic jobs, events, custom PostgreSQL schemas, SQLite, and a +unique and periodic jobs, events, custom Postgres schemas, SQLite, and a Rust and Go service sharing one database. The [River documentation](https://riverqueue.com/docs) explains queueing concepts. diff --git a/rust/riverqueue/examples/custom_schema.rs b/rust/riverqueue/examples/custom_schema.rs index 46b85adbb..e33829936 100644 --- a/rust/riverqueue/examples/custom_schema.rs +++ b/rust/riverqueue/examples/custom_schema.rs @@ -1,4 +1,4 @@ -//! Keeps River's tables in their own PostgreSQL schema. +//! Keeps River's tables in their own Postgres schema. //! //! ```sh //! DATABASE_URL=postgres://localhost/river_example cargo run -p riverqueue --example custom_schema @@ -32,7 +32,7 @@ async fn main() -> Result<(), Box> { client .database() .as_postgres() - .expect("client is configured for PostgreSQL") + .expect("client is configured for Postgres") .schema() ); Ok(()) diff --git a/rust/riverqueue/examples/transactions.rs b/rust/riverqueue/examples/transactions.rs index 50e0dd383..cb6598b44 100644 --- a/rust/riverqueue/examples/transactions.rs +++ b/rust/riverqueue/examples/transactions.rs @@ -34,7 +34,7 @@ async fn confirm_order( let pool = client .database() .as_postgres() - .expect("this example uses PostgreSQL") + .expect("this example uses Postgres") .pool() .clone(); diff --git a/rust/riverqueue/src/__private.rs b/rust/riverqueue/src/__private.rs index 3fb858260..1c0c8ffb1 100644 --- a/rust/riverqueue/src/__private.rs +++ b/rust/riverqueue/src/__private.rs @@ -158,7 +158,7 @@ pub fn sqlite_timestamp(time: DateTime) -> String { crate::database::sqlite::sqlite_time(time) } -/// Adds an add-on crate's indexes to PostgreSQL's default reindexer list. +/// Adds an add-on crate's indexes to Postgres's default reindexer list. /// /// Names already in the list are skipped. A caller who chose index names /// explicitly with `PostgresReindexConfig::with_index_names`, including an @@ -283,7 +283,7 @@ impl fmt::Display for NotificationTopic { /// Sends notifications on a caller's transaction connection, like Go's /// `riverdriver.Executor.NotifyMany`. /// -/// PostgreSQL issues `pg_notify` on the schema-qualified channel +/// Postgres issues `pg_notify` on the schema-qualified channel /// (`.`, using `current_schema()` when no schema is /// configured), so delivery happens only when the transaction commits. A /// server without `LISTEN`/`NOTIFY`, like YugabyteDB by default, gets no @@ -429,7 +429,7 @@ pub use crate::database::DatabaseKind; #[derive(Clone, Debug)] #[non_exhaustive] pub enum DatabaseConfig { - /// PostgreSQL backend configuration. + /// Postgres backend configuration. #[cfg(feature = "postgres")] Postgres { schema: SchemaName }, /// SQLite backend configuration. @@ -449,7 +449,7 @@ impl DatabaseConfig { } } - /// Returns PostgreSQL's configured schema, if selected. + /// Returns Postgres's configured schema, if selected. #[must_use] #[cfg(feature = "postgres")] pub const fn postgres_schema(&self) -> Option<&SchemaName> { @@ -465,7 +465,7 @@ impl DatabaseConfig { #[doc(hidden)] #[non_exhaustive] pub enum DatabaseConnection<'connection> { - /// PostgreSQL transaction connection. + /// Postgres transaction connection. #[cfg(feature = "postgres")] Postgres(&'connection mut PgConnection), /// SQLite transaction connection. @@ -496,7 +496,7 @@ impl<'connection> DatabaseConnection<'connection> { } } - /// Returns the PostgreSQL connection, if selected. + /// Returns the Postgres connection, if selected. #[must_use] #[cfg(feature = "postgres")] pub fn into_postgres(self) -> Option<&'connection mut PgConnection> { @@ -533,7 +533,7 @@ impl fmt::Debug for DatabaseConnection<'_> { #[derive(Clone)] #[non_exhaustive] pub enum DatabasePool { - /// PostgreSQL pool. + /// Postgres pool. #[cfg(feature = "postgres")] Postgres(PgPool), /// SQLite pool. @@ -553,7 +553,7 @@ impl DatabasePool { } } - /// Returns the caller-owned PostgreSQL pool, if selected. + /// Returns the caller-owned Postgres pool, if selected. #[must_use] #[cfg(feature = "postgres")] pub const fn postgres(&self) -> Option<&PgPool> { @@ -864,7 +864,7 @@ pub trait Pilot: std::any::Any + Send + Sync + 'static { /// How many intercepted completion batches may run concurrently, like /// River Go's `PilotJobCompletionConcurrency`. /// - /// River never exceeds its backend's own limit (two on PostgreSQL, one on + /// River never exceeds its backend's own limit (two on Postgres, one on /// SQLite) and starts a second concurrent batch only when a full batch of /// completions is waiting. The default allows one batch at a time. fn job_set_state_concurrency(&self) -> usize { @@ -1068,7 +1068,7 @@ pub struct NoopPilot; impl Pilot for NoopPilot {} -/// Columns River selects to decode a PostgreSQL job row, qualified by +/// Columns River selects to decode a Postgres job row, qualified by /// `alias`, for use with [`decode_postgres_job_row`]. #[cfg(feature = "postgres")] #[must_use] diff --git a/rust/riverqueue/src/client/builder.rs b/rust/riverqueue/src/client/builder.rs index 17aae2e73..8a4472503 100644 --- a/rust/riverqueue/src/client/builder.rs +++ b/rust/riverqueue/src/client/builder.rs @@ -626,7 +626,7 @@ impl ClientBuilder { /// /// The client then polls for new jobs every queue's fetch poll interval, /// and every two seconds for queue changes and for cancellations of its - /// running jobs requested by other clients. A client using a PostgreSQL + /// running jobs requested by other clients. A client using a Postgres /// server without `LISTEN`/`NOTIFY`, like YugabyteDB by default, runs /// this way on its own. #[must_use] diff --git a/rust/riverqueue/src/client/completer.rs b/rust/riverqueue/src/client/completer.rs index 2d96d9b70..14e581cc4 100644 --- a/rust/riverqueue/src/client/completer.rs +++ b/rust/riverqueue/src/client/completer.rs @@ -44,7 +44,7 @@ const COMPLETION_BATCH_DELAY: Duration = Duration::from_millis(10); /// The bounded channel then applies backpressure to workers, as River Go's /// backlog wait does. pub(super) const COMPLETION_BACKLOG_LIMIT: usize = COMPLETION_BATCH_SIZE * 2; -/// Most concurrent batch writes River OSS issues on PostgreSQL. +/// Most concurrent batch writes River OSS issues on Postgres. #[cfg(feature = "postgres")] const COMPLETION_POSTGRES_CONCURRENCY: usize = 2; /// Attempts in one retry cycle, matching River Go's `numRetries`. @@ -489,7 +489,7 @@ async fn persist_with_retries( /// writes its durable wakeup inside the completion transaction instead. #[cfg_attr( not(feature = "postgres"), - allow(clippy::unused_async, reason = "only PostgreSQL sends a notification") + allow(clippy::unused_async, reason = "only Postgres sends a notification") )] async fn notify_interrupted_jobs(inner: &ClientInner, batch: &[CompletionUpdate], rows: &[JobRow]) { let interrupted = batch @@ -551,7 +551,7 @@ async fn notify_interrupted_jobs(inner: &ClientInner, batch: &[CompletionUpdate] /// current row is returned so its event reflects the state that won. #[allow( clippy::too_many_lines, - reason = "keeps PostgreSQL batch and transactionally equivalent SQLite completion together" + reason = "keeps Postgres batch and transactionally equivalent SQLite completion together" )] pub(super) async fn persist_completion_batch( inner: &ClientInner, diff --git a/rust/riverqueue/src/client/insert.rs b/rust/riverqueue/src/client/insert.rs index aff2bd35b..faf8b8bbb 100644 --- a/rust/riverqueue/src/client/insert.rs +++ b/rust/riverqueue/src/client/insert.rs @@ -700,7 +700,7 @@ impl Client { } // A unique key may appear only once among the batch's jobs whose - // state it covers. PostgreSQL rejects River Go's single upsert that + // state it covers. Postgres rejects River Go's single upsert that // would affect the same row twice, and River Go checks SQLite // batches the same way. let mut unique_keys = std::collections::HashSet::new(); diff --git a/rust/riverqueue/src/client/jobs.rs b/rust/riverqueue/src/client/jobs.rs index a05ec5f7a..ac8482870 100644 --- a/rust/riverqueue/src/client/jobs.rs +++ b/rust/riverqueue/src/client/jobs.rs @@ -126,7 +126,7 @@ impl<'a> Jobs<'a> { /// the deleted rows in list order. /// /// At most the filter's limit of jobs are deleted. Running jobs are - /// skipped before the limit applies, and PostgreSQL also skips jobs + /// skipped before the limit applies, and Postgres also skips jobs /// locked by another transaction rather than waiting for them. /// /// # Errors diff --git a/rust/riverqueue/src/client/mod.rs b/rust/riverqueue/src/client/mod.rs index 70d321102..2b987349d 100644 --- a/rust/riverqueue/src/client/mod.rs +++ b/rust/riverqueue/src/client/mod.rs @@ -81,7 +81,7 @@ pub(crate) const ATTEMPTED_BY_MAX: i32 = 100; const EVENT_BUFFER_CAPACITY: usize = 10_000; const PENDING_CANCELLATION_LIMIT: usize = 10_000; const PENDING_CANCELLATION_RETENTION: Duration = Duration::from_mins(1); -// Large queues otherwise become limited by a single PostgreSQL claim round trip. +// Large queues otherwise become limited by a single Postgres claim round trip. // Concurrent `SKIP LOCKED` claims safely divide the available worker slots. const PARALLEL_FETCH_MINIMUM: usize = 1_000; const QUEUE_CONFIG_POLL_INTERVAL: Duration = Duration::from_secs(2); @@ -180,7 +180,7 @@ impl ClientInner { &self.database } - /// Returns the PostgreSQL server's capabilities, detecting them with + /// Returns the Postgres server's capabilities, detecting them with /// `executor` the first time. #[cfg(feature = "postgres")] pub(crate) async fn postgres_capabilities<'e>( @@ -197,9 +197,9 @@ impl ClientInner { } /// Whether this client hears committed notifications through a notifier, - /// a PostgreSQL listener or SQLite outbox poller, like River Go's client + /// a Postgres listener or SQLite outbox poller, like River Go's client /// notifier. A poll-only client has none, and neither does a client of a - /// PostgreSQL server without `LISTEN`/`NOTIFY` once that's detected. + /// Postgres server without `LISTEN`/`NOTIFY` once that's detected. pub(crate) fn has_notifier(&self) -> bool { !self.poll_only && self.database.delivers_notifications() } diff --git a/rust/riverqueue/src/client/notifier.rs b/rust/riverqueue/src/client/notifier.rs index da75fb637..be9aa976e 100644 --- a/rust/riverqueue/src/client/notifier.rs +++ b/rust/riverqueue/src/client/notifier.rs @@ -152,7 +152,7 @@ pub(super) fn dispatch_notification( } } -/// Listens for PostgreSQL notifications until cancelled. +/// Listens for Postgres notifications until cancelled. /// /// The listener uses a dedicated connection opened with the client pool's /// connect options, like River Go's hijacked listener connection, so it never @@ -268,10 +268,7 @@ async fn listen_until_error( ) })?? .ok_or_else(|| { - Error::runtime_context( - "notification listener", - "PostgreSQL current_schema() is null", - ) + Error::runtime_context("notification listener", "Postgres current_schema() is null") })?, }; schema.insert(resolved).clone() diff --git a/rust/riverqueue/src/client/producer.rs b/rust/riverqueue/src/client/producer.rs index 48950f67e..fa68924f9 100644 --- a/rust/riverqueue/src/client/producer.rs +++ b/rust/riverqueue/src/client/producer.rs @@ -58,7 +58,7 @@ pub(super) async fn run_dynamic_queues( ) -> Result<(), Error> { // Without a notifier, running jobs learn of cancellation requests by // polling until every producer has drained. Whether the client has one is - // known only once a PostgreSQL server's capabilities are detected, so the + // known only once a Postgres server's capabilities are detected, so the // poll checks each time. let _cancellation_poll = AbortOnDrop(tokio::spawn(poll_job_cancellations( Arc::clone(&inner), @@ -145,7 +145,7 @@ fn jittered_fetch_poll_interval(interval: Duration) -> Duration { /// Cancels this client's running attempts whose jobs have a cancellation /// request, checking every [`QUEUE_CONFIG_POLL_INTERVAL`] while the client /// has no notifier, like River Go's producers without one. That's checked -/// each time, since a PostgreSQL server's lack of `LISTEN`/`NOTIFY` is +/// each time, since a Postgres server's lack of `LISTEN`/`NOTIFY` is /// detected only once the client runs. /// It keeps checking after `stopping` fires, so jobs can still be cancelled /// while producers drain; the caller aborts it once they have. @@ -760,7 +760,7 @@ pub(super) async fn run_queue( // Like Go's `pollForSettingChanges`, only a client without a // notifier polls queue state; one with a notifier learns of // changes from control notifications, and a listener reconnect - // broadcasts a refresh of every queue. Whether a PostgreSQL + // broadcasts a refresh of every queue. Whether a Postgres // server supports notifications is detected only once the client // runs, so this is checked on each tick. _ = queue_config_poll.tick() => (false, !inner.has_notifier()), @@ -875,7 +875,7 @@ pub(super) async fn run_queue( Err(SessionClaimError::Protocol(protocol_error)) => break Err(protocol_error), } } - // Boxed: two concurrent PostgreSQL claims make a large future. + // Boxed: two concurrent Postgres claims make a large future. _ => Box::pin(fetch_available(&inner, &queue, available, &fetch_cancel)).await, }; last_fetch = Some(tokio::time::Instant::now()); @@ -1022,7 +1022,7 @@ async fn claim_through_session( } /// Claims available jobs with River's own statements, splitting a large -/// PostgreSQL claim in two. +/// Postgres claim in two. async fn fetch_available( inner: &ClientInner, queue: &str, @@ -1147,7 +1147,7 @@ pub(crate) async fn standard_claim( } } -/// River's PostgreSQL claim statement for this client's schema. +/// River's Postgres claim statement for this client's schema. #[cfg(feature = "postgres")] fn standard_claim_sql(inner: &ClientInner) -> String { let table = inner.schema.qualify("river_job"); diff --git a/rust/riverqueue/src/client/record.rs b/rust/riverqueue/src/client/record.rs index 7d616a5fc..e523c2a23 100644 --- a/rust/riverqueue/src/client/record.rs +++ b/rust/riverqueue/src/client/record.rs @@ -119,7 +119,7 @@ pub(crate) fn saturating_i16(value: i64) -> i16 { i16::try_from(value).unwrap_or(if value < 0 { i16::MIN } else { i16::MAX }) } -/// A PostgreSQL job row. Columns the database constrains decode strictly, while +/// A Postgres job row. Columns the database constrains decode strictly, while /// those that can hold values River can't represent are kept as their decode /// results. #[cfg(feature = "postgres")] diff --git a/rust/riverqueue/src/client/resign.rs b/rust/riverqueue/src/client/resign.rs index f2cd63027..11ab6921d 100644 --- a/rust/riverqueue/src/client/resign.rs +++ b/rust/riverqueue/src/client/resign.rs @@ -37,7 +37,7 @@ request_type! { /// A leadership resignation request, returned by /// [`Client::request_resign`]. Await it to send the request. /// - /// A client without notifications, poll-only or using a PostgreSQL + /// A client without notifications, poll-only or using a Postgres /// server without `LISTEN`/`NOTIFY`, hears its own request directly once /// the request commits, and no other client hears it. If the request is /// dropped while that commit is in flight, the request may commit without diff --git a/rust/riverqueue/src/client/run.rs b/rust/riverqueue/src/client/run.rs index 251057a7e..f8c42bac0 100644 --- a/rust/riverqueue/src/client/run.rs +++ b/rust/riverqueue/src/client/run.rs @@ -36,7 +36,7 @@ impl Client { /// unpersisted, stops the client: work is then cancelled, every worker is /// awaited, and [`RunHandle::wait`] returns the error. /// - /// With notifications enabled on PostgreSQL, the client opens one + /// With notifications enabled on Postgres, the client opens one /// dedicated listener connection with the pool's connect options. It is /// not taken from, and does not count against, the pool's /// `max_connections`. diff --git a/rust/riverqueue/src/client/tests.rs b/rust/riverqueue/src/client/tests.rs index bf3dd6eef..3c769ffe0 100644 --- a/rust/riverqueue/src/client/tests.rs +++ b/rust/riverqueue/src/client/tests.rs @@ -148,7 +148,7 @@ async fn go_notification_fixtures_dispatch_correctly() { assert_eq!(fixture.notifications.len(), names.len()); // Dispatch is synchronous and needs no database connection. Exercise it - // in both PostgreSQL-only and SQLite-only builds. + // in both Postgres-only and SQLite-only builds. #[cfg(feature = "postgres")] let pool = sqlx::PgPool::connect_lazy("postgres://localhost/unused").unwrap(); #[cfg(not(feature = "postgres"))] diff --git a/rust/riverqueue/src/client/validate.rs b/rust/riverqueue/src/client/validate.rs index 7906248a6..0f8080ae0 100644 --- a/rust/riverqueue/src/client/validate.rs +++ b/rust/riverqueue/src/client/validate.rs @@ -94,7 +94,7 @@ pub(super) fn validate_identifier(identifier: &str, description: &str) -> Result || !characters.all(|character| character == '_' || character.is_ascii_alphanumeric()) { return Err(Error::invalid_job(format!( - "invalid PostgreSQL {description} identifier {identifier:?}" + "invalid Postgres {description} identifier {identifier:?}" ))); } Ok(()) diff --git a/rust/riverqueue/src/database.rs b/rust/riverqueue/src/database.rs index bf8c6d7b5..f42dcc53d 100644 --- a/rust/riverqueue/src/database.rs +++ b/rust/riverqueue/src/database.rs @@ -18,7 +18,7 @@ use sqlx::{Sqlite, SqliteConnection, SqlitePool}; use sqlx::{Transaction, pool::PoolConnection}; use thiserror::Error; -/// Begins a PostgreSQL transaction that is never abandoned half-started. +/// Begins a Postgres transaction that is never abandoned half-started. /// /// SQLx 0.9 records a transaction only once the server has answered `BEGIN`. If /// the future beginning it is dropped after `BEGIN` reaches the server but @@ -127,7 +127,7 @@ pub(crate) use private::DatabaseExecutorSealed as DatabaseExecutor; #[derive(Clone, Copy, Debug)] #[non_exhaustive] pub enum ClientDatabase<'a> { - /// A PostgreSQL client's pool and options. + /// A Postgres client's pool and options. #[cfg(feature = "postgres")] Postgres(&'a PostgresDatabase), /// A SQLite client's pool. @@ -136,7 +136,7 @@ pub enum ClientDatabase<'a> { } impl<'a> ClientDatabase<'a> { - /// Returns the PostgreSQL pool and options, or `None` for another + /// Returns the Postgres pool and options, or `None` for another /// backend. #[cfg(feature = "postgres")] #[must_use] @@ -175,7 +175,7 @@ impl<'a> ClientDatabase<'a> { #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[non_exhaustive] pub enum DatabaseKind { - /// PostgreSQL. + /// Postgres. #[cfg(feature = "postgres")] Postgres, /// SQLite and compatible implementations. @@ -187,21 +187,21 @@ impl fmt::Display for DatabaseKind { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter.write_str(match self { #[cfg(feature = "postgres")] - Self::Postgres => "PostgreSQL", + Self::Postgres => "Postgres", #[cfg(feature = "sqlite")] Self::Sqlite => "SQLite", }) } } -/// A PostgreSQL source and its backend-specific River options. +/// A Postgres source and its backend-specific River options. /// /// River detects what the server supports the first time it needs to know -/// and remembers it for this value and its clones. On PostgreSQL 18 and +/// and remembers it for this value and its clones. On Postgres 18 and /// later, a unique insert tells a new row from an existing one with /// `RETURNING OLD`, and with `xmax` before that. /// -/// YugabyteDB works as a PostgreSQL server. It has no `xmax`, so a unique +/// YugabyteDB works as a Postgres server. It has no `xmax`, so a unique /// insert marks its row with a random `river:unique_nonce` metadata value, /// as on SQLite. Unless its `yb_enable_listen_notify` setting is on, it has /// no `LISTEN`/`NOTIFY` either: River then sends no notifications, and a @@ -223,7 +223,7 @@ pub struct PostgresDatabase { #[cfg(feature = "postgres")] impl PostgresDatabase { - /// Uses a PostgreSQL pool and the connection's current schema. + /// Uses a Postgres pool and the connection's current schema. #[must_use] pub fn new(pool: PgPool) -> Self { Self { @@ -246,7 +246,7 @@ impl PostgresDatabase { &self.capabilities } - /// Returns the database with PostgreSQL's periodic concurrent index + /// Returns the database with Postgres's periodic concurrent index /// rebuilding configured. #[must_use] pub fn with_reindex(mut self, reindex: PostgresReindexConfig) -> Self { @@ -261,13 +261,13 @@ impl PostgresDatabase { self.reindex.extend_default_index_names(names); } - /// Returns PostgreSQL reindexer configuration. + /// Returns Postgres reindexer configuration. #[must_use] pub const fn reindex(&self) -> &PostgresReindexConfig { &self.reindex } - /// Returns the database with an explicit PostgreSQL schema for River + /// Returns the database with an explicit Postgres schema for River /// objects and notification channels. #[must_use] pub fn with_schema(mut self, schema: SchemaName) -> Self { @@ -275,7 +275,7 @@ impl PostgresDatabase { self } - /// Returns the configured PostgreSQL schema. + /// Returns the configured Postgres schema. #[must_use] pub const fn schema(&self) -> &SchemaName { &self.schema @@ -293,7 +293,7 @@ impl fmt::Debug for PostgresDatabase { } } -/// PostgreSQL-specific concurrent reindexer configuration. +/// Postgres-specific concurrent reindexer configuration. #[cfg(feature = "postgres")] #[derive(Clone, Debug)] pub struct PostgresReindexConfig { @@ -396,7 +396,7 @@ impl Default for PostgresReindexConfig { } } -/// Schedule used by PostgreSQL's concurrent reindexer. +/// Schedule used by Postgres's concurrent reindexer. #[cfg(feature = "postgres")] #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[non_exhaustive] diff --git a/rust/riverqueue/src/database/erased.rs b/rust/riverqueue/src/database/erased.rs index f6f2fd264..a4e9b93c2 100644 --- a/rust/riverqueue/src/database/erased.rs +++ b/rust/riverqueue/src/database/erased.rs @@ -69,7 +69,7 @@ impl Database { /// Whether the backend delivers notifications to listeners when a /// transaction commits, like Go's `SupportsListener`. SQLite clients poll /// a notification outbox instead, so operations River commits itself also - /// wake the local client directly. A PostgreSQL-compatible server without + /// wake the local client directly. A Postgres-compatible server without /// `LISTEN`/`NOTIFY`, like YugabyteDB by default, has no listener once /// detected. pub(crate) fn supports_listener(&self) -> bool { @@ -82,7 +82,7 @@ impl Database { } /// Whether committed notifications reach other clients: through - /// `LISTEN`/`NOTIFY` on PostgreSQL, assumed until a server without it is + /// `LISTEN`/`NOTIFY` on Postgres, assumed until a server without it is /// detected, and through the notification outbox on SQLite. pub(crate) fn delivers_notifications(&self) -> bool { match &self.inner { @@ -93,7 +93,7 @@ impl Database { } } - /// Returns the PostgreSQL server capabilities cache, or `None` for + /// Returns the Postgres server capabilities cache, or `None` for /// another backend. #[cfg(feature = "postgres")] #[cfg_attr( @@ -113,8 +113,8 @@ impl Database { } } - /// Returns the PostgreSQL schema, or `None` for a backend without - /// PostgreSQL schemas. + /// Returns the Postgres schema, or `None` for a backend without + /// Postgres schemas. #[must_use] pub fn postgres_schema(&self) -> Option<&SchemaName> { match &self.inner { diff --git a/rust/riverqueue/src/database/postgres_capabilities.rs b/rust/riverqueue/src/database/postgres_capabilities.rs index 9b9c74d3d..82e98f247 100644 --- a/rust/riverqueue/src/database/postgres_capabilities.rs +++ b/rust/riverqueue/src/database/postgres_capabilities.rs @@ -1,7 +1,7 @@ -//! Features of a PostgreSQL-compatible server that River adapts to, like +//! Features of a Postgres-compatible server that River adapts to, like //! River Go's `riverdriver.PostgresCapabilities`. //! -//! YugabyteDB speaks PostgreSQL's protocol but has no `xmax` system column +//! YugabyteDB speaks Postgres's protocol but has no `xmax` system column //! and, unless configured for it, no `LISTEN`/`NOTIFY`. River detects the //! server once per database and caches the result, so enabling Yugabyte's //! notifications takes effect only for a new database value, such as after @@ -26,9 +26,9 @@ pub(crate) enum UniqueInsertMode { /// The proposed row's metadata carries a random nonce, and a returned /// row without it is an existing one. Used where `xmax` is unavailable. MetadataNonce, - /// PostgreSQL 18's `OLD` row in `RETURNING`. + /// Postgres 18's `OLD` row in `RETURNING`. ReturningOld, - /// PostgreSQL's `xmax` system column, nonzero for an updated row. + /// Postgres's `xmax` system column, nonzero for an updated row. Xmax, } @@ -45,7 +45,7 @@ impl UniqueInsertMode { } } -/// Features detected from a PostgreSQL-compatible server. +/// Features detected from a Postgres-compatible server. #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub(crate) struct PostgresCapabilities { /// Whether `pg_notify` delivers notifications to listeners. Without it, diff --git a/rust/riverqueue/src/database/sqlite.rs b/rust/riverqueue/src/database/sqlite.rs index 856eeb052..c6d67739b 100644 --- a/rust/riverqueue/src/database/sqlite.rs +++ b/rust/riverqueue/src/database/sqlite.rs @@ -121,7 +121,7 @@ pub(crate) enum BackendError { Json(#[from] serde_json::Error), } -/// Reports SQLite failures the way PostgreSQL's reach callers: as SQLx's own +/// Reports SQLite failures the way Postgres's reach callers: as SQLx's own /// error, with stored values River can't decode as [`sqlx::Error::Decode`]. impl From for sqlx::Error { fn from(error: BackendError) -> Self { @@ -643,7 +643,7 @@ fn push_attempted_by_appended(query: &mut QueryBuilder, params: &ClaimJo /// /// The caller keeps selection and this update in one transaction. Eligibility /// beyond the final running-state guard is deliberately the selector's -/// responsibility, matching the PostgreSQL interception path. +/// responsibility, matching the Postgres interception path. pub(crate) async fn claim_selected( connection: &mut SqliteConnection, params: &ClaimJobs<'_>, @@ -797,7 +797,7 @@ pub(crate) async fn list( } /// Pushes conditions that the JSON object `source` (an SQL expression) -/// contains `fragment`, with PostgreSQL's `jsonb @>` semantics: each key must +/// contains `fragment`, with Postgres's `jsonb @>` semantics: each key must /// be present with a contained value. Keys and scalars are bound, so no JSON /// path quoting is involved. fn push_contains_object( @@ -820,7 +820,7 @@ fn push_contains_object( } /// Pushes a condition that the `json_each` row `alias` contains `fragment`. -/// Like PostgreSQL, scalars match only scalars of the same type (numbers +/// Like Postgres, scalars match only scalars of the same type (numbers /// compare numerically), objects match objects containing every key, and an /// array matches an array containing each of its elements. fn push_contains_value( diff --git a/rust/riverqueue/src/job/metadata.rs b/rust/riverqueue/src/job/metadata.rs index 81f2c90bb..16ab98e72 100644 --- a/rust/riverqueue/src/job/metadata.rs +++ b/rust/riverqueue/src/job/metadata.rs @@ -7,7 +7,7 @@ use serde_json::{Map, Value, value::RawValue}; /// A JSON object whose original value tokens remain intact. /// -/// PostgreSQL may store numbers beyond the range of `serde_json::Value`, so +/// Postgres may store numbers beyond the range of `serde_json::Value`, so /// decoding the entire object into a map can make an otherwise valid job /// unreadable. This type keeps the persisted text and decodes only requested /// fields. Database-side metadata merges preserve unrelated value tokens. diff --git a/rust/riverqueue/src/maintenance/cleaner.rs b/rust/riverqueue/src/maintenance/cleaner.rs index 4a0514ddc..22cdb3854 100644 --- a/rust/riverqueue/src/maintenance/cleaner.rs +++ b/rust/riverqueue/src/maintenance/cleaner.rs @@ -110,7 +110,7 @@ async fn clean_jobs_batch( } } -/// Runs the job cleaner's deletion on PostgreSQL. +/// Runs the job cleaner's deletion on Postgres. #[cfg(feature = "postgres")] pub(crate) async fn postgres_delete_finalized_jobs( connection: &mut sqlx::PgConnection, diff --git a/rust/riverqueue/src/maintenance/mod.rs b/rust/riverqueue/src/maintenance/mod.rs index 27a6cfa73..684f10f49 100644 --- a/rust/riverqueue/src/maintenance/mod.rs +++ b/rust/riverqueue/src/maintenance/mod.rs @@ -12,7 +12,7 @@ //! window elapses, and a new term starts only after the previous term's //! services have stopped. //! - Every maintenance database call is selected against the term token. On -//! PostgreSQL, cancellation and timeouts are enforced server-side with +//! Postgres, cancellation and timeouts are enforced server-side with //! `SET LOCAL statement_timeout` and `pg_cancel_backend`, so abandoned work //! does not keep holding locks. @@ -177,7 +177,7 @@ impl From for MaintenanceError { impl From for MaintenanceError { fn from(error: sqlx::Error) -> Self { - // PostgreSQL reports a `statement_timeout` expiry as `query_canceled`. + // Postgres reports a `statement_timeout` expiry as `query_canceled`. // Explicit cancellation through `pg_cancel_backend` is reported as // `Cancelled` before a database error is ever mapped. if let sqlx::Error::Database(database_error) = &error @@ -363,7 +363,7 @@ async fn batch_backoff(cancel: &CancellationToken) -> Result<(), MaintenanceErro /// Runs a SQLite operation under the term token and a client-side deadline. /// /// SQLite executes statements on the client, so dropping the future cannot -/// leave server-side work holding locks the way it can on PostgreSQL. +/// leave server-side work holding locks the way it can on Postgres. #[cfg(feature = "sqlite")] async fn sqlite_cancellable( cancel: &CancellationToken, diff --git a/rust/riverqueue/src/maintenance/postgres.rs b/rust/riverqueue/src/maintenance/postgres.rs index 44ecd1f7e..8e105f694 100644 --- a/rust/riverqueue/src/maintenance/postgres.rs +++ b/rust/riverqueue/src/maintenance/postgres.rs @@ -1,4 +1,4 @@ -//! PostgreSQL helpers that make maintenance statements cancellable and +//! Postgres helpers that make maintenance statements cancellable and //! bounded on the server, not just abandoned by the client. use std::time::Duration; @@ -136,7 +136,7 @@ pub(super) async fn cancellable_within( } } -/// Asks PostgreSQL to cancel the statement running on `backend_pid`. +/// Asks Postgres to cancel the statement running on `backend_pid`. pub(super) async fn cancel_backend(pool: &PgPool, backend_pid: i32) { let result = tokio::time::timeout( CANCEL_GRACE, diff --git a/rust/riverqueue/src/maintenance/tests.rs b/rust/riverqueue/src/maintenance/tests.rs index d390001c5..7abf51bd7 100644 --- a/rust/riverqueue/src/maintenance/tests.rs +++ b/rust/riverqueue/src/maintenance/tests.rs @@ -1,4 +1,4 @@ -//! PostgreSQL tests of individual maintenance services, ported from Go's +//! Postgres tests of individual maintenance services, ported from Go's //! `internal/maintenance` and `internal/leadership` suites. Each test uses its //! own freshly migrated schema and fails when `RIVER_RUST_DATABASE_URL` is //! unset. @@ -327,7 +327,7 @@ impl Pilot for StaleSnapshotPilot { connection: DatabaseConnection<'_>, params: &RescueManyParams, ) -> Result { - let connection = connection.into_postgres().expect("PostgreSQL connection"); + let connection = connection.into_postgres().expect("Postgres connection"); let completed = self.completed.lock().unwrap().clone(); let reclaimed = self.reclaimed.lock().unwrap().clone(); assert!(params.jobs.iter().any(|job| completed.contains(&job.id))); diff --git a/rust/riverqueue/src/pilot.rs b/rust/riverqueue/src/pilot.rs index 3406ca9b5..0a0ba2b45 100644 --- a/rust/riverqueue/src/pilot.rs +++ b/rust/riverqueue/src/pilot.rs @@ -148,7 +148,7 @@ pub struct ProducerConfiguration { /// Most jobs this client runs from the queue at once. pub max_workers: usize, /// The text of the queue's persisted metadata as the database renders - /// it: PostgreSQL's `metadata::text` or SQLite's `json(metadata)`. Unlike + /// it: Postgres's `metadata::text` or SQLite's `json(metadata)`. Unlike /// the parsed `queue.metadata`, it keeps key order, duplicate keys, and /// number literals, for decoding the metadata exactly like River Go's /// `encoding/json`. diff --git a/rust/riverqueue/src/query.rs b/rust/riverqueue/src/query.rs index 69e79a4ad..bd610fb90 100644 --- a/rust/riverqueue/src/query.rs +++ b/rust/riverqueue/src/query.rs @@ -379,7 +379,7 @@ impl JobListParams { } /// Matches jobs whose metadata contains this JSON object, like - /// PostgreSQL's `@>` operator. + /// Postgres's `@>` operator. #[must_use] pub fn metadata(mut self, metadata: Map) -> Self { self.metadata = Some(metadata); @@ -562,7 +562,7 @@ pub(crate) struct JobListKeyset { pub(crate) after: Option, pub(crate) direction: SortDirection, /// Whether the time field may be null for listed jobs. Nulls then sort - /// explicitly last ascending and first descending, the PostgreSQL + /// explicitly last ascending and first descending, the Postgres /// default, so that every backend agrees and cursors can match them. pub(crate) nullable: bool, /// Time field ordered before ID, or `None` to order by ID alone. diff --git a/rust/riverqueue/src/storage/postgres.rs b/rust/riverqueue/src/storage/postgres.rs index 1ae5ae0f0..316eb3587 100644 --- a/rust/riverqueue/src/storage/postgres.rs +++ b/rust/riverqueue/src/storage/postgres.rs @@ -1,4 +1,4 @@ -//! PostgreSQL implementation of River's storage operations. +//! Postgres implementation of River's storage operations. use chrono::{DateTime, Utc}; use serde_json::{Map, Value}; @@ -11,7 +11,7 @@ use crate::database::postgres_capabilities::CapabilitiesCache; use crate::query::{JobListSqlPart, JobListTimeField}; use crate::{Error, JobListParams, JobRow, JobState, Queue, SchemaName}; -/// PostgreSQL storage bound to one connection. +/// Postgres storage bound to one connection. pub(super) struct PostgresBackend<'c> { /// The database's detected server capabilities, or `None` to detect /// them for each statement that needs them. @@ -434,7 +434,7 @@ fn job_list_sql_parts( ); let state_type = schema.qualify("river_job_state"); // Like Go (upstream 35c4eab8), a single-state list without metadata - // predicates compares state with equality so PostgreSQL can use the + // predicates compares state with equality so Postgres can use the // `(state,