This commit is contained in:
Matheus
2026-09-23 12:29:08 -03:00
commit f5d231ab8f
59 changed files with 16658 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
# Queries
Named SQL queries registered in `vitruvio.json`. Plain `.sql` files — one query per file.
Used as datasources for reports, DBTable components, and referenced by key in scripts via the `db` lib.
## Rules
- One `SELECT` per file. No multiple statements, no DDL.
- Named bind parameters use `:paramName` syntax (same as inline SQL in scripts).
- Write ANSI SQL where possible. If DB-specific syntax is unavoidable, keep both Oracle and PostgreSQL in mind — or note the limitation.
- Queries should be read-only. For INSERT/UPDATE/DELETE, use inline SQL in scripts.
## vitruvio.json registration
```json
"queries": [
{
"key": "my-query",
"name": "My Query",
"source": "queries/my-query.sql",
"connection": "vitruvio_producao"
}
]
```