Skip to content

refactor: Extract schemaCacheLoad from retryingSchemaCacheLoad#4856

Draft
mkleczek wants to merge 1 commit intoPostgREST:mainfrom
mkleczek:push-loklyrrxypws
Draft

refactor: Extract schemaCacheLoad from retryingSchemaCacheLoad#4856
mkleczek wants to merge 1 commit intoPostgREST:mainfrom
mkleczek:push-loklyrrxypws

Conversation

@mkleczek
Copy link
Copy Markdown
Collaborator

@mkleczek mkleczek commented Apr 28, 2026

DISCLAIMER:
This commit was authored entirely by a human without the assistance of LLMs.

This change decouples schema cache loading logic from connection acquisition and retrying logic.

Created a new function schemaCacheLoad :: AppState -> SQL.Session () implementing a single schema cache load attempt. Its return type is Hasql.Session so that it abstracts away connection acquisition and can be easily reused in various context - among others in the Listener thread reusing its database connection.

This PR is a prerequisite to implement schema cache loading from master as discussed in #4842

This change decouples schema cache loading logic from connection acquisition and retrying logic.
Created a new function `schemaCacheLoad :: AppState -> SQL.Session ()` implementing a single schema cache load attempt. The return type is `Hasql.Session` so that it abstracts away connection acquisition and can be easily reused in various context - among others in the Listener thread reusing its database connection.
@mkleczek mkleczek marked this pull request as draft April 28, 2026 13:05
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.

1 participant