
I built a SQL query inspector for Nuxt
I've been working with Nuxt + SQL for a while, and one thing that kept annoying me during development was figuring out what SQL queries an API request actually executed.
For example, when an endpoint feels slow, I want to quickly answer:
- How many SQL queries did this request execute?
- Which queries were executed?
- How long did each query take?
- Which API endpoint triggered them?
- Am I accidentally doing 20 queries when I expected 2?
Normally, I'd end up adding logging around the database client and digging through the terminal.
So I built nuxt-sql-inspector to make this easier.
It adds a development-only SQL inspector to Nuxt at:
/__sql_queries
You can see the API request and the SQL queries it triggered, along with query timing and other useful information.
It currently supports several common SQL drivers, including PostgreSQL, postgres.js, mysql2, SQLite, and Nitro db0, and can be used with ORMs such as Drizzle and Prisma depending on the underlying driver.
The goal is pretty simple:
API request → SQL queries → timings
without having to dig through console logs.
GitHub: https://github.com/drowhann/nuxt-sql-inspector
It's still a relatively small project, so I'm particularly interested in feedback from people using Nuxt + Drizzle/Prisma/Postgres.
What would you want to see in a SQL inspector like this?