Skip to content

Add a Database Connection

This section will walk you through the steps of connecting your database to Rose. This enables you to query and save data from the database directly in Rose using a Query Module.

Adding a Connection

  1. Start by adding a Query Module :octicons-database-16: from the left-hand menu.
  2. From the dropdown above the top right of the module select + Add connection. select a database

  3. This pop-up form should appear:
    add db connection menu

  4. Fill out the fields with your databse information

    1. Connection Name: The name this database connection will be called in Rose
      • Example: crypto_ethereum
      • Note: name cannot contain spaces or commas
    2. Database Type: Select from the following options.
      1. postgresql
      2. mysql
      3. bigquery
    3. Connection String/Object: Either the connection string or JSON object for your database.
      1. postgresql and mysql connection string:
        postgresql+psycopg2://<db user name>:<db user password>@<db host address>:<port>/<db name>
        
      2. bigquery: the connection object is the JSON credential file from a google cloud service account
        {"type": "service_account",
        "project_id": "example_project",
        "private_key_id": "...",
        "private_key": "...",
        "client_email": "...",
        "client_id": "...",
        "auth_uri": "...",
        "token_uri": "...",
        "auth_provider_x509_cert_url": "...",
        "client_x509_cert_url": "..."
        }
        

BigQuery: How to Get the JSON Credentials

  1. After creating the service account
  2. Select the service account from the account listing.
  3. Go to the Keys tab.
  4. Click Add Key and select Create Key.
  5. Then select JSON and the file will be downloaded.