Robin Irmer
09/08/2022, 3:37 PMconst value = 'test';
const results = await prismaClient.$queryRaw`
SELECT * FROM "contact"
WHERE "textSearch" @@ to_tsquery('english', '${query}')
ORDER BY ts_rank("textSearch", to_tsquery('english', '${query}')) DESC
LIMIT 10;
;`;
PrismaClientKnownRequestError:
Invalid `prisma.queryRaw()` invocation:
Your raw query had an incorrect number of parameters. Expected: `0`, actual: `2`.
{
code: 'P1016',
clientVersion: '3.0.2',
meta: { expected: 0, actual: 2 }
}
Raphael Etim
09/08/2022, 5:09 PMconst value = 'test';
const results = await prismaClient.$queryRaw`
SELECT * FROM "contact"
WHERE "textSearch" @@ to_tsquery('english', ${query})
ORDER BY ts_rank("textSearch", to_tsquery('english', ${query})) DESC
LIMIT 10`;
Robin Irmer
09/09/2022, 8:18 AMRobin Irmer
09/09/2022, 8:19 AMPrismaClientKnownRequestError:
Invalid `prisma.queryRaw()` invocation:
Raw query failed. Code: `N/A`. Message: `error deserializing column 8: cannot convert between the Rust type `core::option::Option<alloc::string::String>` and the Postgres type `tsvector`` {
code: 'P2010',
clientVersion: '3.0.2',
meta: {
code: 'N/A',
message: 'error deserializing column 8: cannot convert between the Rust type `core::option::Option<alloc::string::String>` and the Postgres type `tsvector`'
}
}
Robin Irmer
09/09/2022, 8:26 AMSELECT * FROM "contact"
WHERE "textSearch" @@ to_tsquery('english', 'Robin')
ORDER BY ts_rank("textSearch", to_tsquery('english', 'Robin')) DESC
LIMIT 10
Raphael Etim
09/09/2022, 8:28 AMtsvector
Raphael Etim
09/09/2022, 8:28 AM