Hi there, it's me again, when using queryRaw, we s...
# orm-help
j
Hi there, it's me again, when using queryRaw, we should handle boolean fields with 1 and 0 rather than true or false?, or is there a way to still use true and false?
n
Hey Juan 👋 Using true/false or 1/0 both should work as expected. I tried the below query with PostgreSQL and both of them worked as expected. Using true/false:
Copy code
const rawCreateUser =
    await prisma.$queryRaw`INSERT INTO "public"."User" ("email","name","isAdmin") VALUES ('<mailto:test@prisma.io|test@prisma.io>','test','false') RETURNING "public"."User"."id"`;
Using 1/0:
Copy code
const rawCreateUser2 =
    await prisma.$queryRaw`INSERT INTO "public"."User" ("email","name","isAdmin") VALUES ('<mailto:sun3@prisma.io|sun3@prisma.io>','test','0') RETURNING "public"."User"."id"`;