Databao docs

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.

  1. 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.

  2. Credentials should be read-only and restricted using the principle of least privilege.

  3. 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.

  1. In your project directory, run:

    databao datasource add
  2. Follow the prompts to add connection details.

  3. 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.

  1. In the Terminal, navigate to the project directory and launch the Databao web interface:

    databao datasource app
  2. (Optional) If you haven't already, initialize a project by clicking Initialize project.

  3. In the Data sources section, select the database type, provide credentials, and other connection details.

  4. Click Add datasource.

  5. To add more connections, repeat the steps.

Enable or disable a database connection

  1. In the Terminal, navigate to the project directory and launch the Databao web interface:

    databao datasource app
  2. 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:

  1. Application Default Credentials
  2. Service account JSON credentials (as a JSON string)
  3. Service account JSON key file

Snowflake

Important

To be able connect to Snowflake, install the ADBC Snowflake driver.

Databao supports connecting to Snowflake using the following authentication methods:

  1. Password auth (username and password)
  2. RSA key pair
  3. SSO (Single Sign-On)

On this page