770 B
770 B
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
SELECTper file. No multiple statements, no DDL. - Named bind parameters use
:paramNamesyntax (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
"queries": [
{
"key": "my-query",
"name": "My Query",
"source": "queries/my-query.sql",
"connection": "vitruvio_producao"
}
]