forgejo/models/issues
pat-s c39a4368af
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
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
..
TestGetUIDsAndStopwatch feat: add foreign keys to stopwatch & tracked_time tables (#9373) 2025-10-01 00:31:38 +02:00
action_aggregator.go feat(ui): add links to review request targets in issue comments (#8239) 2025-07-23 04:45:58 +02:00
action_aggregator_test.go feat(ui): add links to review request targets in issue comments (#8239) 2025-07-23 04:45:58 +02:00
assignees.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
assignees_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
comment.go chore: Remove IsDeleted from action (activity) table (#9829) 2025-11-08 04:20:05 +01:00
comment_code.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
comment_list.go fix: load OldMilestone based on OldMilestoneID, not MilestoneID (#8330) 2025-06-29 12:08:03 +02:00
comment_list_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
comment_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
content_history.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
content_history_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
dependency.go refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
dependency_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue.go chore: fix typo (#10188) 2025-11-21 12:36:28 +01:00
issue_index.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_index_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_label.go fix: possible cause of invalid issue counts; cache invalidation occurs before a active transaction is committed (#10130) 2025-11-17 01:07:29 +01:00
issue_label_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_list_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
issue_lock.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_project.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_project_test.go chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7648) 2025-04-25 09:14:33 +00:00
issue_search.go fix: do not display the title of unsubscribed issues or pull requests in the notification web page (#9362) 2025-09-19 22:32:06 +02:00
issue_stats.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_stats_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_test.go fix: do not display the title of unsubscribed issues or pull requests in the notification web page (#9362) 2025-09-19 22:32:06 +02:00
issue_update.go fix: possible cause of invalid issue counts; cache invalidation occurs before a active transaction is committed (#10130) 2025-11-17 01:07:29 +01:00
issue_user.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_user_test.go refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
issue_watch.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_watch_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_xref.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_xref_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
label.go fix: possible cause of invalid issue counts; cache invalidation occurs before a active transaction is committed (#10130) 2025-11-17 01:07:29 +01:00
label_internal_test.go fix: reduce deadlocks merging PRs w/ async milestone stat recalcs (#9916) 2025-10-31 15:53:45 +01:00
label_test.go fix: reduce deadlocks merging PRs w/ async label stat recalcs (#9868) 2025-10-31 02:12:36 +01:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
milestone.go fix: possible cause of invalid issue counts; cache invalidation occurs before a active transaction is committed (#10130) 2025-11-17 01:07:29 +01:00
milestone_internal_test.go fix: reduce deadlocks merging PRs w/ async milestone stat recalcs (#9916) 2025-10-31 15:53:45 +01:00
milestone_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
milestone_test.go refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
moderation.go feat: Admin interface for abuse reports (#7905) 2025-07-23 00:20:15 +02:00
moderation_test.go feat: Admin interface for abuse reports (#7905) 2025-07-23 00:20:15 +02:00
pull.go feat: show link to pull requests targeting a non-default branch when pushing (#10079) 2025-11-19 14:59:13 +01:00
pull_list.go feat: show more relevant results for 'dependencies' dropdown (#8003) 2025-06-26 20:06:21 +02:00
pull_test.go feat: show link to pull requests targeting a non-default branch when pushing (#10079) 2025-11-19 14:59:13 +01:00
reaction.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
reaction_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
review.go fix: PR not blocked by review request for a whitelisted team (#8511) 2025-07-15 23:21:42 +02:00
review_list.go chore: ensure consistent import aliasing for services and models (#10253) 2025-11-30 17:00:57 +01:00
review_test.go chore: ensure consistent import aliasing for services and models (#10253) 2025-11-30 17:00:57 +01:00
stopwatch.go feat: add foreign keys to stopwatch & tracked_time tables (#9373) 2025-10-01 00:31:38 +02:00
stopwatch_test.go chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7648) 2025-04-25 09:14:33 +00:00
tracked_time.go feat: add foreign keys to stopwatch & tracked_time tables (#9373) 2025-10-01 00:31:38 +02:00
tracked_time_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00