For AI agents: the complete documentation index is available at /waveless/llms.txt, the full documentation bundle is available at /waveless/llms-full.txt, and this page is available as Markdown at /waveless/guide/reference/project/databases.md.

Connecting to databases

Waveless accepts multiple database connection at runtime being defined the under [[databases]] array. A generic id and an optional is_primary might be set:

[[databases]]
id = "main"
is_primary = true

Then the backend should be specified using [databases.connection.{backend_name}] and setting the required fields by the given backend.

Note that there could be multiple databases with different backends: multiple MySQL databases and Redis as a cache engine could be combined.

An example of a MySQL configuration (using the waveless_sql backend) is given:

[databases.connection.MySQL]
host = "127.0.0.1:3306"
username = "alpine"
password = "alpine"
db = "groceries"

Get more details at waveless_commons::project::DatabaseConfig.