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

Incorrect Error Statement #5

Open
saklanipankaj opened this issue Jun 20, 2019 · 5 comments
Open

Incorrect Error Statement #5

saklanipankaj opened this issue Jun 20, 2019 · 5 comments

Comments

@saklanipankaj
Copy link

CREATE TABLE t2
(
    a DOUBLE,
    b INT ENCRYPTED FOR (MULTIPLICATION, ADDITION, RANGE),
    c INT,
    d VARCHAR(10) ENCRYPTED FOR (STORE, SEARCH),
    e VARCHAR(30)
);

Error Statement: 42601: syntax error at or near "ENCRYPTED"
Error is the wrong DATATYPE DOUBLE being used, should be DOUBLE PRECISION, however the error message states the syntax error to be near the word "ENCRYPTED"

@cheziyi
Copy link
Member

cheziyi commented Jun 21, 2019

Currently, if Prisma/DB is unable to parse a statement (due to a wrong or unsupported syntax), it will forward the query to the database directly. This is because we do not have support of the full SQL language yet. Therefore, the error thrown is by the database itself, which does not recognize the ENCRYPTED keyword.

That said, better error messages are in the pipeline, so cases like this will be less confusing to the user.

@bazzilic
Copy link
Contributor

if Prisma/DB is unable to parse a statement (due to a wrong or unsupported syntax), it will forward the query to the database directly

@cheziyi I think Prisma/DB no longer does this?

@cheziyi
Copy link
Member

cheziyi commented Sep 15, 2020

if Prisma/DB is unable to parse a statement (due to a wrong or unsupported syntax), it will forward the query to the database directly

@cheziyi I think Prisma/DB no longer does this?

It does, as long as it can't be parsed.

@bazzilic
Copy link
Contributor

Are you sure? My understanding was that whatever can't be parsed errors out, and if you need to send through you can do PRISMADB BYPASS ...

@cheziyi
Copy link
Member

cheziyi commented Sep 15, 2020

Are you sure? My understanding was that whatever can't be parsed errors out, and if you need to send through you can do PRISMADB BYPASS ...

Yup, queries that can't be parsed are sent to the database directly to attempt to have as much support for DB clients as possible. PRISMADB BYPASS is meant for queries that can be parsed, but we do not want to execute at the proxy. It will still work for queries that can't be parsed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants