Unskip test to check that listener can take prefix from search_path#859
Merged
Unskip test to check that listener can take prefix from search_path#859
search_path#859Conversation
The change in #848 added a capability to the listener so that in case a schema is _not_ explicitly provided, it can be detected from `search_path` so that multiple Rivers could share a database as long as their search paths are configured correctly. This was tricky to test though because listeners acquire their own connections, and we don't want to set search path on the database pool because it'd taint a connection on it and we wouldn't be guaranteed to get that connection for the listener anyway. I marked the test case as skipped until I could go and look at it again. Here, add a function to listeners that causes them to invoke an SQL command after a connection is acquired. This should only be used in tests, but lets us check this case. It's a little gnarly to be sure, but the river driver interface is explicitly marked as unstable, and I can't think of any alternatives that aren't worse.
bgentry
approved these changes
Apr 27, 2025
Contributor
bgentry
left a comment
There was a problem hiding this comment.
Seems perfectly fine for now, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The change in #848 added a capability to the listener so that in case a
schema is not explicitly provided, it can be detected from
search_pathso that multiple Rivers could share a database as long astheir search paths are configured correctly.
This was tricky to test though because listeners acquire their own
connections, and we don't want to set search path on the database pool
because it'd taint a connection on it and we wouldn't be guaranteed to
get that connection for the listener anyway. I marked the test case as
skipped until I could go and look at it again.
Here, add a function to listeners that causes them to invoke an SQL
command after a connection is acquired. This should only be used in
tests, but lets us check this case. It's a little gnarly to be sure, but
the river driver interface is explicitly marked as unstable, and I can't
think of any alternatives that aren't worse.