Austin Zentz
02/03/2022, 6:48 PMNick B
02/03/2022, 6:50 PMNick B
02/03/2022, 6:51 PMAustin Zentz
02/03/2022, 6:51 PMNick B
02/03/2022, 6:51 PMNick B
02/03/2022, 6:52 PMAustin Zentz
02/03/2022, 6:52 PMAustin Zentz
02/03/2022, 6:53 PMAustin Zentz
02/03/2022, 6:54 PMNick B
02/03/2022, 6:56 PMRyan Delaney
02/03/2022, 7:02 PMShaul Zuarets
02/03/2022, 8:00 PMwhere
clause and with the proper tenant ID - I’ve added a Prisma middleware for that.
I’ve wrote (me and @yakirgot) a new npm package for all of it here, and the code is here.
I have two questions:
1. in different languages, I used to work with database hooks or scope to get this functionality and I wonder if middleware is the right approach in prisma. Am I missing anything?
2. My where
clause validation is pretty simple and straightforward, I would love to get your opinion on it.
PS, you are all more than welcome to contribute, there is still much work needed :)
Thanks in advance,
ShaulAustin Zentz
02/03/2022, 8:09 PMGreger gregerson
02/03/2022, 8:55 PMAlex Vilchis
02/03/2022, 9:12 PMLevy Barbosa
02/03/2022, 9:46 PMItsMeAlfie0
02/04/2022, 8:12 AMANUP KUMAR
02/04/2022, 8:42 AMKay Khan
02/04/2022, 9:43 AMimage_imageToperson_profile_image_id
const data: any = await prisma.mview_entity_inheritance.findMany({
include: {
person: { include: { image_imageToperson_profile_image_id: true } },
},
where: { service_id: { in: serviceIds } },
});
Kay Khan
02/04/2022, 10:16 AMview
using prisma with queryraw
. I want to select multiple rows using the sql "IN" however i get the error:
Raw query failed. Code: `N/A`. Message: `Arrays are not supported in MySQL.`
const entityIds = ["9704cad8-c69e-4e85-9f12-e9ea6055d140"];
const socials = await prisma.$queryRawUnsafe("SELECT * FROM view_quick_reach WHERE brand_id IN (?)", entityIds);
Kay Khan
02/04/2022, 10:17 AMOksana Danshyna
02/04/2022, 10:19 AMAlex Vilchis
02/04/2022, 3:26 PMmigrations/
directory and create an entirely new migration history? My migrate dev
command is taking too long with 116 migrations 😕Jonathan Marbutt
02/04/2022, 5:44 PMRichard Kaufman-López
02/04/2022, 8:31 PM///
comments work on enum values? https://www.prisma.io/docs/concepts/components/prisma-schema#commentsNadeshi Kon
02/05/2022, 5:02 AMBrook MG
02/05/2022, 11:15 AMChris
02/05/2022, 11:32 AMconst data = await prisma.$queryRaw`SELECT * FROM Series WHERE name LIKE '%${series}%';`
prisma:info Starting a sqlite pool with 17 connections.
prisma:query SELECT * FROM Series WHERE name LIKE '%?%';
/Users/chriscoughlan/Code/longbox/backend/node_modules/@prisma/client/runtime/index.js:38703
throw new PrismaClientKnownRequestError(message, e.code, this.prisma._clientVersion, e.meta);
^
PrismaClientKnownRequestError:
Invalid `prisma.queryRaw()` invocation:
Raw query failed. Code: `N/A`. Message: `N/A`
at cb (/Users/chriscoughlan/Code/longbox/backend/node_modules/@prisma/client/runtime/index.js:38703:17)
at async Proxy._request (/Users/chriscoughlan/Code/longbox/backend/node_modules/@prisma/client/runtime/index.js:40853:18) {
code: 'P2010',
clientVersion: '3.9.1',
meta: { code: 'N/A', message: 'N/A' }
}
Any ideas?Chris
02/05/2022, 11:33 AMconst data = await prisma.$queryRaw`SELECT * FROM Series WHERE name = ${series};`
Works fineAytaç Ünal
02/05/2022, 3:01 PM