Skip to main content

Configure Database

We recommend using the Devii Portal for testing and adding databases, however you can login to Devii Portal's Database (tenantid 14) and use it's endpoints to create additional databases.

Using Devii API to Test and Create Databases

Test Database Connection

It's recommended to test the database connection with Devii before trying to create a new database.

{
Utility {
check_connection(
driver: "mysql"
host: "database.host.name"
database: "demo"
username: "username"
password: "password"
)
}
}

Create Database record with Devii

This will create the connection to your database, and

mutation create_database($input: databaseInput!) {
create_database(input: $input) {
tenantid
name
projectid
database_env_id
description
isInternal
id
database_platform_id
admin_roleid
}
}
Variables
{
"input": {
"keystore_secrets": {
"host": "database.host.name",
"database": "demo",
"username": "username",
"password": "password"
},
"name": "Demo DB",
"projectid": "<View Note>",
"database_env_id": 1,
"description": "Description for Demo Database",
"isInternal": false,
"database_platform_id": 2
}
}

Output:

{
"data": {
"create_database": {
"admin_roleid": 1111,
"database_env_id": 1,
"database_platform_id": 2,
"description": "Description for Demo Database",
"id": "42",
"isInternal": false,
"name": "Demo DB",
"projectid": 42,
"tenantid": 42
}
}
}

Set up white list tables

Introspect database

After making changes to your database you must reintrospect the database for your changes to be queried and/or mutated

query util{
Utility{
introspect
}
}