Databases
Prepare a database
Before configuring a connection, make sure to prepare the database to ensure secure, reliable, and non-disruptive access to your data.
-
Whenever possible, connect Databao to a read-only replica instead of the primary production database. This isolates Databao-generated queries from operational workloads and reduces the risk of performance impact.
-
Credentials should be read-only and restricted using the principle of least privilege.
-
Confirm that the database is reachable from the environment where Databao is running.
Configure a database connection
You can create a database connection through the terminal, in the Databao web interface, or by adding a configuration file manually.
-
In your project directory, run:
databao datasource add -
Follow the prompts to add connection details.
-
To check the database configuration, run:
databao datasource check
The connection details are saved in the databao/domains/<domain>/src/<connection-name>.yaml file.
To update the connection details, edit the file directly.
-
In the Terminal, navigate to the project directory and launch the Databao web interface:
databao datasource app -
(Optional) If you haven't already, initialize a project by clicking Initialize project.
-
In the Data sources section, select the database type, provide credentials, and other connection details.
-
Click Add datasource.
-
To add more connections, repeat the steps.
Enable or disable a database connection
-
In the Terminal, navigate to the project directory and launch the Databao web interface:
databao datasource app -
In the Data sources section, find the connection you want to enable or disable and select its state in Enabled.
Database connection details are stored in the databao/domains/<domain>/src/<connection-name>.yaml file.
To disable a connection, add enabled: false to the configuration file.
type: snowflake
enabled: false
name: snowflake_prod
...To re-enable a connection, set enabled to true or remove the enabled: false line completely.
type: snowflake
enabled: false
name: snowflake_prod
...Connection details
BigQuery
You can provide BigQuery authentication credentials in one of the following ways:
- Application Default Credentials
- Service account JSON credentials (as a JSON string)
- Service account JSON key file
Snowflake
To be able connect to Snowflake, install the ADBC Snowflake driver.
Databao supports connecting to Snowflake using the following authentication methods:
- Password auth (username and password)
- RSA key pair
- SSO (Single Sign-On)