question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Postgres: Schema does not default to current schema for references when Pt. 2

See original GitHub issue

What 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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
vanthomecommented, Nov 11, 2021

let me rebase and update the PR first

1reaction
vanthomecommented, Mar 23, 2021

Next try here: https://github.com/sequelize/sequelize/pull/13136

@papb please check and merge this time.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found