initial
This commit is contained in:
@@ -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"
|
||||
}
|
||||
]
|
||||
```
|
||||
Reference in New Issue
Block a user