Skip to content

refactor: Isolate unrelated errors in the Error module#4433

Draft
nikita-volkov wants to merge 20 commits intoPostgREST:mainfrom
nikita-volkov:refactor-errors/1
Draft

refactor: Isolate unrelated errors in the Error module#4433
nikita-volkov wants to merge 20 commits intoPostgREST:mainfrom
nikita-volkov:refactor-errors/1

Conversation

@nikita-volkov
Copy link
Copy Markdown

This is exclusively a structural refactoring of the PostgREST.Error module, which decouples various errors by distributing them across cohesive modules. It also encapsulates the helper definitions.

  • No changes to the API of the refactored module.
  • No changes in its implementation.
  • No renamings.
  • Reformatting avoided as much as possible.

I've noticed myself needing this refactoring while working on migrating the codebase to the upcoming release of Hasql. After this refactoring that concern is now clearly located under the PostgREST.Error.PgError.* namespace.

@wolfgangwalther
Copy link
Copy Markdown
Member

while working on migrating the codebase to the upcoming release of Hasql

Please note that we are still stuck on the versioning we are currently using, because we still need to support GHC 9.4 for the time being. So there is no quick way forward. Also some other PRs already have code to update hasql, once we get there, for example 612dfec.

@nikita-volkov
Copy link
Copy Markdown
Author

because we still need to support GHC 9.4 for the time being. So there is no quick way forward.

The latest releases of Hasql and the upcoming version is tested to support GHC down to 8.10. So there should be no issue with that.

@wolfgangwalther
Copy link
Copy Markdown
Member

The latest releases of Hasql and the upcoming version is tested to support GHC down to 8.10. So there should be no issue with that.

Interesting. I would have to look into that again, but I don't think it works with the Nixpkgs-provided GHC 9.4. I think this relates to the fact that Nixpkgs always forces the core libraries in the version that the compiler shipped with. IIRC we'd hit bounds for containers very quickly.

@nikita-volkov
Copy link
Copy Markdown
Author

Let's check. If any issues come up, they should be easy to fix.

Also please notice that this PR is just refactoring and doesn't deal with dependencies.

@nikita-volkov
Copy link
Copy Markdown
Author

Pinging to remind about this PR. It's just a refactoring. No behaviour or dependency changes here.

Due to the stalling of this PR, it now has conflicts with master. I can resolve those, but I need assurances that you're willing to merge it and it's not gonna be a waste of time.

@taimoorzaeem taimoorzaeem marked this pull request as draft April 1, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants