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
- Start by adding a Query Module :octicons-database-16: from the left-hand menu.
-
From the dropdown above the top right of the module select + Add connection.
-
This pop-up form should appear:
-
Fill out the fields with your databse information
- Connection Name: The name this database connection will be called in Rose
- Example: crypto_ethereum
- Note: name cannot contain spaces or commas
- Database Type: Select from the following options.
- postgresql
- mysql
- bigquery
- Connection String/Object: Either the connection string or JSON object for your database.
- postgresql and mysql connection string:
postgresql+psycopg2://<db user name>:<db user password>@<db host address>:<port>/<db name>
- 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": "..." }
- postgresql and mysql connection string:
- Connection Name: The name this database connection will be called in Rose
BigQuery: How to Get the JSON Credentials
- After creating the service account
- Select the service account from the account listing.
- Go to the Keys tab.
- Click Add Key and select Create Key.
- Then select JSON and the file will be downloaded.