Skip to content

Scope functions and triggers to schema search path#168

Merged
teoljungberg merged 1 commit intoteoljungberg:masterfrom
tylerhunt:schema_search_path
Aug 11, 2025
Merged

Scope functions and triggers to schema search path#168
teoljungberg merged 1 commit intoteoljungberg:masterfrom
tylerhunt:schema_search_path

Conversation

@tylerhunt
Copy link
Contributor

Updates the function and trigger queries for PostgreSQL to only return objects from the current schema search path.

This is based on how Rails limits dumping objects like enums (rails/rails#47791).

Resolves #164.

@teoljungberg teoljungberg merged commit 398879b into teoljungberg:master Aug 11, 2025
16 of 18 checks passed
@teoljungberg
Copy link
Owner

Looks great! I'll happily port this in. The test failure seems to have been a cosmic fluke.

I'll do a release with this included soon.

@tylerhunt
Copy link
Contributor Author

@teoljungberg Thanks!

@teoljungberg
Copy link
Owner

Hm, the tests are indeed flaky after this. See #169 as I'm trying to reproduce it without pushing more commits to master.

Any ideas as to how to fix this @tylerhunt ?

@tylerhunt
Copy link
Contributor Author

The specs seem to have been flaky to begin with. Running rake passes fine, but the order in which the specs run appears to be important, as RSpec's order randomization causes issues (e.g. rspec --seed 40439). These issues appear on master even before this PR was merged (tested with 9edd1da). It's probably not a trivial task to make them idempotent, and I don't know how far back the issue goes.

@teoljungberg
Copy link
Owner

Huh, I have not run into this. I wonder what caused it.

@tylerhunt
Copy link
Contributor Author

Hmm, I may be wrong about the randomization bit, since I see now that CI is using rake and that calling rake also randomizes the specs.

@frank-west-iii
Copy link

Pull request successfully merged and closed

You're all set — the branch has been merged.

Hey @teoljungberg, any plan to release a new version soon? We are adding fx and having to monkey patch for this same reason. Thanks!

@teoljungberg
Copy link
Owner

@frank-west-iii - I can absolutely make that happen. Give me a few days. In the meantime you can point to a commit from master that gives you the unreleased features you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support functions in different schemas / search_paths

3 participants