gitforge/models/fixtures
pat-s c39a4368af refactor: migrate from lib/pq to jackc/pgx (#10219)
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>
2025-11-30 17:47:45 +01:00
..
ModerationFeatures fix: make sure to use unaltered fields when saving a shadow copy for updated profiles or comments (#8533) 2025-07-20 23:52:58 +02:00
PrivateIssueProjects fix: consider public issues for project boards (#7143) 2025-03-06 23:26:08 +00:00
TestActivateUserEmail fix: user activation with uppercase email address (#8367) 2025-07-02 13:04:22 +02:00
TestAddTeamReviewRequest fix: PR not blocked by review request for a whitelisted team (#8511) 2025-07-15 23:21:42 +02:00
TestGetUnmergedPullRequestsByHeadInfoMax
TestGetUsedForUser fix: ignore expired artifacts for quota calculation (#7976) 2025-05-28 18:22:10 +02:00
TestPackagesGetOrInsertBlob fix: package_blob.has_blake2b may be null (#7520) 2025-04-11 12:28:03 +00:00
TestParseCommitWithSSHSignature fix: prevent commit API from leaking user's hidden email address on valid GPG signed commits 2025-10-24 11:35:51 -06:00
TestPrivateRepoProjects fix: consider issues in repository accessible via access table (#7270) 2025-03-19 16:45:42 +00:00
TestTwoFactorWithPasswordChange fix: endless redirection loop between /user/settings/change_password and /user/settings/security (#10002) 2025-11-07 21:12:47 +01:00
access.yml
access_token.yml
action.yml fix: make the action feed resilient to database inconsistencies (#8617) 2025-07-22 23:40:30 +02:00
action_artifact.yml feat: artifacts can be downloaded using their id instead of their name (#8957) 2025-08-25 15:51:26 +02:00
action_run.yml refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
action_run_job.yml refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
action_runner.yml feat: auto cleanup of offline runners (#7803) 2025-06-08 00:13:37 +02:00
action_runner_token.yml refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
action_task.yml refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
action_task_output.yml Fix missing outputs for jobs with matrix (#32823) 2024-12-15 10:14:21 +01:00
action_user.yml feat: add ActionUser model & fields to ActionRun 2025-11-06 11:07:38 +01:00
attachment.yml
branch.yml fix: fix ci dashboard e2e test (#7338) 2025-03-26 00:19:31 +00:00
collaboration.yml
comment.yml refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
commit_status.yml feat: improve GetLatestCommitStatusForPairs 2024-11-16 13:23:40 +01:00
commit_status_index.yml
email_address.yml
follow.yml fix(ui): ensure same width of usercards in grid (#6799) 2025-05-25 13:31:53 +02:00
forgejo_blocked_user.yml
gpg_key.yml
hook_task.yml chore: QoL improvements to tests (#7917) 2025-05-21 15:45:56 +02:00
issue.yml
issue_assignees.yml
issue_index.yml
issue_label.yml
issue_user.yml
issue_watch.yml
label.yml test: prevent XSS for label rendering 2025-06-27 13:27:06 +02:00
lfs_meta_object.yml
milestone.yml
mirror.yml
notice.yml
notification.yml feat: rework notification table (#9926) 2025-11-29 23:03:56 +01:00
oauth2_application.yml
oauth2_authorization_code.yml
oauth2_grant.yml
org_user.yml
project.yml
project_board.yml
project_issue.yml
protected_tag.yml
public_key.yml
pull_request.yml fix: remove artificial delay for PR update (#7773) 2025-05-04 21:54:55 +00:00
reaction.yml
release.yml
renamed_branch.yml
repo_redirect.yml chore: add repo redirect unit test 2025-08-30 09:37:38 +02:00
repo_topic.yml
repo_transfer.yml
repo_unit.yml feat: make action runs available in api (#7699) 2025-06-02 22:05:12 +02:00
repository.yml fix: reduce deadlocks merging PRs by using caching for repo issue count stats (#9922) 2025-10-31 23:50:05 +01:00
review.yml Fix the logic of finding the latest pull review commit ID (#32139) 2024-10-06 07:44:28 +02:00
star.yml
stopwatch.yml
system_setting.yml disable gravatar in test (#32529) 2024-11-24 15:42:36 +00:00
team.yml refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
team_repo.yml
team_unit.yml fix: always render detailed team permissions table in sidebar (#8108) 2025-06-09 10:37:31 +02:00
team_user.yml
topic.yml
tracked_time.yml feat: add foreign keys to stopwatch & tracked_time tables (#9373) 2025-10-01 00:31:38 +02:00
two_factor.yml feat: migrate TOTP secrets to keying 2024-11-27 00:34:16 +01:00
user.yml feat: ability to filter listed accounts by type in admin dashboard (#9455) 2025-09-29 15:35:40 +02:00
user_open_id.yml
user_redirect.yml chore: add unit test 2025-08-30 09:37:30 +02:00
watch.yml
webauthn_credential.yml [FEAT] Add support for webauthn credential level 3 2024-08-29 10:05:03 +02:00
webhook.yml