Skip to content

chore(deps): update hasql to 1.9.3.1 - #4829

Merged
wolfgangwalther merged 1 commit into
PostgREST:mainfrom
wolfgangwalther:hasql-1-9
Apr 27, 2026
Merged

chore(deps): update hasql to 1.9.3.1#4829
wolfgangwalther merged 1 commit into
PostgREST:mainfrom
wolfgangwalther:hasql-1-9

Conversation

@wolfgangwalther

Copy link
Copy Markdown
Member

I originally had most of these changes in #4193 and some more on a local GHC 9.12 branch. @mkleczek came to many of the same changes in #4797. I took some of mine, some of his.

(first commit is still from #4193, only the second commit is relevant here)

Comment thread src/PostgREST/Config/Database.hs Outdated
queryDbSettings preConfFunc prepared =
let transaction = if prepared then SQL.transaction else SQL.unpreparedTransaction in
transaction SQL.ReadCommitted SQL.Read $ SQL.statement dbSettingsNames $ SQL.Statement sql (arrayParam HE.text) decodeSettings prepared
SQL.transaction SQL.ReadCommitted SQL.Read $ SQL.statement dbSettingsNames $ SQL.Statement sql (arrayParam HE.text) decodeSettings prepared

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: unpreparedTransaction went away? I remember we needed this because otherwise hasql prepared the BEGIN and COMMIT statements.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steve-chavez steve-chavez Apr 20, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm lost as where is this prepared bool now passed to prevent Hasql to prepare those TCL statements.

Although we have this test that should prove this behavior is maintained:

def test_db_prepared_statements_disable(defaultenv):
"Should not use any prepared statements when the setting is disabled."
env = {
**defaultenv,
"PGRST_DB_PREPARED_STATEMENTS": "false",
}
with run(env=env) as postgrest:
response = postgrest.session.post("/rpc/uses_prepared_statements")
assert response.text == "false"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite get why I still pass prepared around here - but it seems to work. I did not look at the coverage report, though - there is probably a place somewhere, where this prepared thing is unused, and I should just remove it from here.

I had hoped for codecov to tell me, but somehow the job only fails, but doesn't post annotations? I'm not sure whether that's new, possibly since the latest updates, or when that started failing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had hoped for codecov to tell me, but somehow the job only fails, but doesn't post annotations?

That's been going on for a while now, also miss it. I have to go to codecov UI to see them

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So passing prepared around is actually wrong here - and it has been before. This boolean is not really about whether to actually prepare the statement, but to tell hasql whether that statement is "preparable". Whether it is actually prepared or not is then determined by enabling prepared statements in the connection settings.

This means, I should just change all those instances of where prepared is still passed around to constant booleans (aka True).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had hoped for codecov to tell me, but somehow the job only fails, but doesn't post annotations?

That's been going on for a while now, also miss it. I have to go to codecov UI to see them

I've tried e2a677e, let's see what that does.

But in general, the future of annotations for codecov doesn't look bright - they are deprecated: https://docs.codecov.com/docs/github-checks - the same site also mentions some codecov browser extension one can use: https://docs.codecov.com/docs/the-codecov-browser-extension

@wolfgangwalther

Copy link
Copy Markdown
Member Author

This is now only the relevant commit, the other PR has been merged. Will let that one sit for an actual review, since there are code changes (all the other PRs so far were only CI / nix stuff, so CI gave the feedback I needed).

@wolfgangwalther
wolfgangwalther marked this pull request as ready for review April 19, 2026 18:01
Comment thread src/PostgREST/Version.hs
Comment thread nix/overlays/haskell-packages.nix Outdated
Comment thread postgrest.cabal Outdated
Michael and I arrived at mostly the same things independently. Took some
of his, some of mine.

Co-authored-by: Michal Kleczek <michal@kleczek.org>
@wolfgangwalther

Copy link
Copy Markdown
Member Author

No other comments came up and there is already more work lining up behind this (#4222), so merging.

@wolfgangwalther
wolfgangwalther merged commit a5cc457 into PostgREST:main Apr 27, 2026
62 of 74 checks passed
@wolfgangwalther
wolfgangwalther deleted the hasql-1-9 branch April 27, 2026 09:12
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.

3 participants