Skip to content

Prisma Spans don't include SQL #5780

@silent1mezzo

Description

@silent1mezzo

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_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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions