mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-12-07 14:09:47 +00:00
This PR migrates the unmaintaiend `lib/pq` library to `jackc/pgx`, which is the de-facto standard lib in go for postgres connections these days. Some implementation notes: We register both `pgx` and `postgresschema` driver names (for backward comp). We can't register `postgres` as this one is still used by `lib/pq` imported by `go-chi/session`, which is in use when users go for the "postgres" session type in the "Session config. It is questionable if anyone is really using the "postgres" driver option in the session config - but for consistency, it would be good to also migrate to `pgx` there, especially as the code lives within Forgejo under [go-chi/session](https://code.forgejo.org/go-chi/session). `pgx` supports multi-host notation in the connection string. New tests have been added therefore. `pgx` also allows for connection string parameters such as `?default_query_exec_mode=simple_protocol`. This should possibly allow running with `pgbouncer` "transaction" mode instead of "session", which could substantially enhance Postgres query handling. ## Checklist ### Tests - I added test coverage for Go changes... - [x] in their respective `*_test.go` for unit tests. - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes - [ ] I do not want this change to show in the release notes. - [x] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10219 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Co-authored-by: pat-s <patrick.schratz@gmail.com> Co-committed-by: pat-s <patrick.schratz@gmail.com>
42 lines
800 B
YAML
42 lines
800 B
YAML
-
|
|
id: 10900
|
|
run_id: 900
|
|
repo_id: 63
|
|
owner_id: 2
|
|
commit_sha: 97f29ee599c373c729132a5c46a046978311e0ee
|
|
is_fork_pull_request: false
|
|
name: job_1
|
|
attempt: 0
|
|
job_id: job_1
|
|
task_id: 0
|
|
status: 1 # success
|
|
runs_on: '["docker"]'
|
|
started: 1683636528
|
|
-
|
|
id: 11900
|
|
run_id: 900
|
|
repo_id: 63
|
|
owner_id: 2
|
|
commit_sha: 97f29ee599c373c729132a5c46a046978311e0ee
|
|
is_fork_pull_request: false
|
|
name: job_2
|
|
attempt: 0
|
|
job_id: job_2
|
|
task_id: 711900
|
|
status: 6 # running
|
|
runs_on: '["docker"]'
|
|
started: 1683636528
|
|
-
|
|
id: 10800
|
|
run_id: 800
|
|
repo_id: 63
|
|
owner_id: 2
|
|
commit_sha: 97f29ee599c373c729132a5c46a046978311e0ee
|
|
is_fork_pull_request: false
|
|
name: job_1
|
|
attempt: 0
|
|
job_id: job_1
|
|
task_id: 0
|
|
status: 7 # blocked
|
|
runs_on: '["docker"]'
|
|
started: 1683636528
|