Database Adapter
The Database Adapter provides a decoupled way to interact with SQL databases, separating connection management from query logic.
Configuration
Connections are defined in config/connections.yaml:
yaml
connections:
- name: "MainDB"
type: "sql"
driver: "postgres"
dsn: "postgres://user:pass@localhost:5432/dbname"Adapter Services
Create a .adapter file to define a specific SQL operation:
yaml
name: "GetUsers"
connection: "MainDB"
operation: "select"
sql: "SELECT * FROM users WHERE status = ${status}"Result Mapping
By default, queries return a results array and a row (first result) object. You can use outputMap to rename columns:
yaml
outputMap:
user_id: "id"
email_address: "email"For more details, see the Full Adapter Reference.
