-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 7 load_async queries public schema when invoking queries on the async thread pool #199
Comments
This appears to fix it: |
@mnovelo is this fixed on main? |
@patbenatar this is not, nor do we have tests to verify whether it's needed. I'll look into it |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Now that I'm done with school I have more time to look into this |
@mnovelo that'd be awesome! |
This wasn't addressed in v3.2.0, but I hope to add such support in v4.0.0. Your help would be greatly appreciated! #312 |
Steps to reproduce
Create a Rails 7 app with load_async enabled (
config.active_record.async_query_executor = :global_thread_pool
). Switch into a tenant schema. Useload_async
to load an AR relation.Expected behavior
Whether the query is invoked async or sync, the records returned should be from the tenant schema.
Actual behavior
The records returned when the query is invoked async are from the public schema.
System configuration
Database: Postgres 13
Apartment version: 7d7c73c
Apartment config (in
config/initializers/apartment.rb
or so):use_schemas
: default, sotrue
Rails (or ActiveRecord) version: 7.0.2.3
Ruby version: 3.1.1
The text was updated successfully, but these errors were encountered: