-
Notifications
You must be signed in to change notification settings - Fork 4
Description
I was thinking about a small feature that could make it even better. Right now, when the logger prints a query, it's all on a single line. This works great for simple queries, but as soon as things get complex—with multiple JOIN
s, WHERE
clauses, and subqueries—the output becomes a long, unreadable string.
It would be a huge quality-of-life improvement if the logger could format the SQL into a clean, multi-line structure.
Instead of the current output:
SELECT "posts"."id", "posts"."title", "users"."name" FROM "posts" LEFT JOIN "users" ON "posts"."author_id" = "users"."id" WHERE "posts"."status" = 'published'
We could see something like this:
SELECT
"posts"."id",
"posts"."title",
"users"."name"
FROM "posts"
LEFT JOIN "users" ON "posts"."author_id" = "users"."id"
WHERE
"posts"."status" = 'published';
This would make debugging complex queries so much faster since you wouldn't have to manually copy and paste the query into a formatter every time.
Is this something you'd consider adding? I think it would be a fantastic enhancement.
Thanks for the great work!