Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

lack of schemaName support #60

Closed
snovak7 opened this issue Aug 19, 2015 · 7 comments
Closed

lack of schemaName support #60

snovak7 opened this issue Aug 19, 2015 · 7 comments

Comments

@snovak7
Copy link

snovak7 commented Aug 19, 2015

I was digging through, and I can't query anything that has schema/database prefix.

@ArsalanDotMe
Copy link

I'm having the same issue. You can fix this issue by bypassing utils.escapeName in sequel/select.js.

@sailsbot
Copy link
Collaborator

sailsbot commented Oct 9, 2015

Thanks for posting, @snovak7. I'm a repo bot-- nice to meet you!

It has been 30 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:

  • review our contribution guide to make sure this submission meets our criteria (only verified bugs with documented features, please; no questions, commentary, or bug reports about undocumented features or unofficial plugins)
  • create a new issue with the latest information, including updated version details with error messages, failing tests, and a link back to the original issue. This allows GitHub to automatically create a back-reference for future visitors arriving from search engines.

Thanks so much for your help!

@sailsbot sailsbot closed this as completed Oct 9, 2015
@dzuluaga
Copy link

dzuluaga commented Nov 3, 2015

Did you guys figure this out? It still writes to public schema, regardless of the schemaName set to the model. Am I missing anything? I'm looking at this http://stackoverflow.com/questions/24380902/database-schema-with-sails-js-and-sails-postgresql

@ArsalanDotMe
Copy link

I only had to read from a custom schema table so I bypassed this issue by
creating a view on public schema.

On Tue, Nov 3, 2015, 11:50 AM Diego Zuluaga notifications@github.com
wrote:

Did you guys figure this out? It still writes to public schema, regardless
of the schemaName set to the model. Am I missing anything? I'm looking at
this
http://stackoverflow.com/questions/24380902/database-schema-with-sails-js-and-sails-postgresql


Reply to this email directly or view it on GitHub
#60 (comment)
.

@dzuluaga
Copy link

dzuluaga commented Nov 3, 2015

Yes. Weird. My use case is slightly different. I'm trying to save a record, but still a pretty common one. I liked Waterline, but I don't know how to tell my customer you can only use public schema for storing data, which seems dangerous. To replicate the issue, you can find the code here: https://github.com/balderdashy/sails-postgresql/issues/207

@ArsalanDotMe
Copy link

When I had the issue, I tried going through the code to find the issue. While I wasn't able to debug the real problem, I was able to find a hack that works.
Basically, in waterline-sequel, it wraps table name in quotation marks. If it's possible for you, you can edit the code to not wrap the table name with quotation marks and in your model, use the table name as yourschema.yourtablename instead of just yourtablename.
Its still an ugly hack but can get you going for the time-being.

@dzuluaga
Copy link

dzuluaga commented Nov 3, 2015

Yeah. I just tried but it fails. It though created a table in public schema with name testmyapischema.user, instead of creating the table under testmyapischema. The model was set as: tableName : 'testmyapischema.user'. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants