Skip to content
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

Do models retain their schema name? #1650

Closed
briancray opened this issue Jan 17, 2020 · 1 comment
Closed

Do models retain their schema name? #1650

briancray opened this issue Jan 17, 2020 · 1 comment

Comments

@briancray
Copy link

@briancray briancray commented Jan 17, 2020

Objection version: 2.1.2

I'm working on an app that uses the same models in different schemas. If I create a model in a schema, then within that model instance make a query, it doesn't seem to include the schema with the table in the query sql.

For example, if I create a model using something like:
await session.$relatedQuery('scraps').withSchema(options.__withSchema).insert(session.scraps)

Then call an instance method on that model, session.scraps.scrape() and within scrape I call const session = await this.$relatedQuery('session'), it doesn't search "select from schema"."sessions" in the sql, instead it's simple select from "sessions".

Any ways about this?

@koskimas

This comment has been minimized.

Copy link
Collaborator

@koskimas koskimas commented Jan 17, 2020

No they don't. There's nothing built-in for this kind of stuff.

@koskimas koskimas closed this Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.