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

Failed constraint checks and partial indexes should raise E_VALIDATION #5097

Closed
kevinburkeshyp opened this issue Aug 20, 2015 · 6 comments
Closed

Comments

@kevinburkeshyp
Copy link

say i have a table like this

CREATE TABLE users (
    "account" integer CHECK "account" >= 0
);

and I try to write -1 as the account balance - this will raise a check failure! in theory this should be a 400 E_VALIDATION instead of a 500 server error, but the latter gets raised.

Similar thing happens for partial indexes - the code matches but they don't match the regex at the bottom of adapter.js.

CREATE UNIQUE INDEX unique_status
    ON accounts ("driverId")
    WHERE "processingState" = 'ACTIVE';

which says, the same driverId can't be set on two different accounts that have the processingState ACTIVE. dumb example sorry but the ones we use this for are currently proprietary.

@particlebanana
Copy link
Contributor

We don't have that fine grained error code checking. It would be great to add it if anyone has the time. Looks like the list of possible error codes is here.

@sailsbot
Copy link

Thanks for posting, @kevinburkeshyp. 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!

@devinivy devinivy reopened this Sep 27, 2015
@devinivy
Copy link

What error does the adapter provide? Waterline doesn't know anything about HTTP errors (400 vs 500, etc.).

@sailsbot
Copy link

Thanks for posting, @kevinburkeshyp. 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!

@devinivy devinivy reopened this Oct 28, 2015
@particlebanana
Copy link
Contributor

Added this to the roadmap as a feature. balderdashy/sails-postgresql@830f50e

@sailsbot
Copy link

Thanks for posting, @kevinburkeshyp. 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!

@johnabrams7 johnabrams7 transferred this issue from balderdashy/sails-postgresql Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants