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

Improve error handling for incorrect raw parameters #2561

Closed
timsuchanek opened this issue May 26, 2020 · 3 comments
Closed

Improve error handling for incorrect raw parameters #2561

timsuchanek opened this issue May 26, 2020 · 3 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/engines Issue for tech Engines. tech/typescript Issue for tech TypeScript. topic: raw $queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli
Milestone

Comments

@timsuchanek
Copy link
Contributor

Since Beta 6, we allow parameters in .raw like so:

const result = await prisma.raw(
  'SELECT * FROM User WHERE id = $1 OR email = $2;',
  1,
  'e@ma.il'
)

While we chose an API, where each parameter is a separate function arg for .raw, the API could also have looked like this:

const result = await prisma.raw(
  'SELECT * FROM User WHERE id = $1 OR email = $2;',
  [1, 'e@ma.il']
)

However, if I provide that, I don't get a lot of help but a PANIC:
prisma/prisma-client-js#705

@timsuchanek timsuchanek added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. process/candidate tech/typescript Issue for tech TypeScript. labels May 26, 2020
@janpio janpio added this to the Beta 7 milestone May 26, 2020
@janpio janpio added topic: raw $queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli and removed process/candidate labels May 26, 2020
@pimeys
Copy link
Contributor

pimeys commented May 28, 2020

@pimeys
Copy link
Contributor

pimeys commented May 28, 2020

prisma/quaint#137

@janpio janpio modified the milestones: Beta 7, Beta 8 May 29, 2020
@janpio janpio added the tech/engines Issue for tech Engines. label Jun 10, 2020
@janpio janpio modified the milestones: Beta 10, 2.1.0 Jun 10, 2020
@pimeys pimeys self-assigned this Jun 18, 2020
@pimeys
Copy link
Contributor

pimeys commented Jun 19, 2020

Fixed in prisma/prisma-engines#827

@pimeys pimeys closed this as completed Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/engines Issue for tech Engines. tech/typescript Issue for tech TypeScript. topic: raw $queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli
Projects
None yet
Development

No branches or pull requests

3 participants