Postgres: Schema does not default to current schema for references when Pt. 2
See original GitHub issueWhat are you doing?
I need to switch schemas dynamically for multi tenancy in an application and when I change the schema for a model, I would like sequalize to default to that schema for transitive gets. This is not the case yet and I would consider this a bug as it’s the only sensible default behaviour.
The main point where this happens is when I call model.schema('ZZZ').getXXX
.
What do you expect to happen?
Sequalize to default to the schema ZZZ also for the related resource.
What is actually happening?
It defaults to no (public) schema.
Environment
Dialect:
- mysql
- postgres
- sqlite
- mssql
- any Dialect library version: XXX Database version: XXX Sequelize version: XXX Node Version: XXX OS: XXX If TypeScript related: TypeScript version: XXX Tested with latest release:
- No
- Yes, specify that version:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Documentation: 15: 5.9. Schemas
The ability to create like-named objects in different schemas complicates writing a query that references precisely the same objects every time.
Read more >Postgres: Schema does not default to the current ...
Postgres : Schema does not default to the current schema when using queryInterface methods like addColumn, removeColumn, sequelize. query, etc, ...
Read more >java - Is it possible to specify the schema when connecting ...
If you leave the schema unspecified, Postgres defaults to a schema named public within the database. See the manual, section 5.9.2 The Public...
Read more >PostgreSQL and default Schemas
The current role needs privileges to access a schema. Schemas are extremely useful if you want to organize things and still be able...
Read more >Demystifying Schemas & search_path through Examples
which is the default. "$user" is a special option that says if there is a schema that matches the current user (vis-à-vis SELECT ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
let me rebase and update the PR first
Next try here: https://github.com/sequelize/sequelize/pull/13136
@papb please check and merge this time.