You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prisma spans show the query type in the description instead of the SQL that was generated (findMany, findUnique, update, etc...)
Other SDKs (Python, Ruby, PHP) for specific frameworks (Django, Rails, Laravel) show the actual SQL that's being generated. Having the SQL makes it easy to see what's happening under the hood and solve things like n+1 queries.
Solution Brainstorm
Having the ORM details is useful, especially for finding them in the codebase.
1. Update the span description
We could update the span description to include the raw SQL ORM call - raw SQL
e.g. Expense findOne - SELECT expenses_expense.* FROM expenses_expenseWHEREexpenses_expense`.id = %s
2. Update the span op
If we wanted to keep it similar to the other SDKs we could have the description as just the raw SQL call and update the Span op to include the ORM call.
span.op: db.prisma.findOne
span.description: SELECT expenses_expense.* FROM expenses_expenseWHEREexpenses_expense.id = %s
The text was updated successfully, but these errors were encountered:
The sql generation / execution is happening inside the prisma/prisma-engines package, which is a rust-based, compiled binary. The prisma client operates with a graphql based intermediary that gets sent down into the engine for execution, but no real execution details (like the executed query) are sent back.
Problem Statement
Prisma spans show the query type in the description instead of the SQL that was generated (
findMany
,findUnique
,update
, etc...)Other SDKs (Python, Ruby, PHP) for specific frameworks (Django, Rails, Laravel) show the actual SQL that's being generated. Having the SQL makes it easy to see what's happening under the hood and solve things like n+1 queries.
Solution Brainstorm
Having the ORM details is useful, especially for finding them in the codebase.
1. Update the span description
We could update the span description to include the raw SQL
ORM call - raw SQL
e.g.
Expense findOne - SELECT
expenses_expense.* FROM
expenses_expenseWHERE
expenses_expense`.id = %s2. Update the span op
If we wanted to keep it similar to the other SDKs we could have the description as just the raw SQL call and update the Span op to include the ORM call.
span.op:
db.prisma.findOne
span.description:
SELECT
expenses_expense.* FROM
expenses_expenseWHERE
expenses_expense.id = %s
The text was updated successfully, but these errors were encountered: