RQ: Raw Query Improvement Epic #12367
Labels
kind/epic
A high-level initiative that has many subtasks.
team/client
Issue for team Client.
topic: breaking change
topic: raw
$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli
Problem
Raw query support provides an important escape hatch for those instances when Prisma doesn't quite support what you need it to support. Over time, we've accumulated a number of raw query bugs. We'd like to fix these issues and start addressing them in a batch.
Goal
We do another pass over our raw query bugs. We understand and fix the ones we can. For the ones we can't, we document the limitation and look for ways to fix them in the future.
Tasks
Umbrella Issues
Issues
These issues came from the Bug Cluster Column
Confirmed Bugs
Legend:
🔴 - Blocked
🟡 - Fixable but breaking
🟢 - Fixable
🟤 - Unknown
Float input/output
🔴 Blocked by Float rework
Incorrect QE query parameter coercion
🟢 Fixable
Incorrect Client result coercion
🟡 BREAKING: Rework needed to propagate type information from QE to Client
$queryRaw
#7395 (bigint)Enum input/output
🟤 Need to be discussed, not sure if there's a solution
Geography type input
🔴 Blocked but a workaround was provided
42704
. Message:db error: ERROR: type \"geography\" does not exist
#2847Void output (non existing type)
🔴 Blocked by rust pg driver (according to the issue comments, to be confirmed)
pg_sleep
crashes #3530Date output
🟤 We currently ignore the timezone when deserializing
TimeTz
type. Next step: figure out whyqueryRaw
fortimetz
data type #7916Unsupported native database type
🔴 Blocked by native database type support
GEOMETRY
- FAIL #9933 (Point type)Incorrect PG query parameter type inferring
🟡 BREAKING: Rework needed to pass in the correct query parameters types
incorrect binary data format in bind parameter 3
#7194Needs text protocol support
🔴 Blocked by Text protocol support
Wrong parameters
🟢 Fixable
Prisma.empty
) (minor impact)Stored procedure output
SQL prepared statements (wrongly escaped expressions)
🟢 Fixable - Most of those aren't bugs, users just misunderstand prepared statements.
$queryRaw
template not working with Jest #1145442P18
. Message:db error: ERROR: could not determine data type of parameter $1
#12531NULLs in scalar lists
🟢 Fixable
N/A
. Message:error deserializing column 0: a Postgres value was
NULL``" error when using Postgres ARRAY_AGG with a nullable column #11339 (array)No error code
JSON.stringify
loses much of error object information vs usingconsole.log
on it #10141Unconfirmed Bugs
🟤 We can hardly reproduce those issues or they're unconfirmed
Result::unwrap()
on anErr
value: Any { .. } in query-engine/connectors/sql-query-connector/src/error.rs:58:51 #10224 (No schema available, can't reproduce)DELETE FROM "${table}";
) does not work #7510Result::unwrap()
on anErr
value: Any { .. } in query-engine/connectors/sql-query-connector/src/error.rs:58:51 #12641 (duplicate of 10224 - needs investigation)New features
Not really a bug, it is something we don't support (yet)
Unsupported
columns in raw queries #13203whereRaw
model query option for Prisma Client queries #5560prisma.$queryRaw
result automatically #4327raw
result #3551raw
queries - support SQL auto completion based on introspection #3550$executeRaw
could support multiple queries from a single string #2868The text was updated successfully, but these errors were encountered: