Esc
Documentation
On this page

A service is one connection to a data tool, such as a PostgreSQL database. You can declare it in dsui.yaml or add it in the workspace. Both need the adapter for that tool to be declared in dsui.yaml first.

Choose where to define the service#

In dsui.yamlIn the workspace
Best forRepeatable setups that you keep in version controlA one-off connection while you explore
IDThe id you chooseA random ID that DSUI generates
CredentialsIn the file, usually as ${NAME} variablesEncrypted in DSUI’s database with the master key
Change itEdit the file. DSUI re-reads it when the workspace loads its servicesDelete the service and add it again
Delete itRemove it from the fileDelete it in the workspace
Required roleNone, you control the filemanage (the admin and owner roles)

A service declared in dsui.yaml can’t be deleted in the workspace. A service ID can’t be defined in both places. DSUI reports Service IDs are managed twice and asks you to remove one.

Declare the adapter#

Under adapters, tell DSUI where to get each adapter. The workspace offers only the adapters you declare here.

yaml
adapters:
  postgresql:
    source: git
    repository: "git+https://github.com/northgraindata/dsui"
    path: packages/adapter-postgresql

The key, postgresql, must match the ID that the adapter declares. DSUI builds the adapter from source when it starts, so the first start needs network access. See troubleshooting if the build fails.

Declare the service in dsui.yaml#

Add the service under services. The adapter value names a key under adapters, and connection holds the fields that the adapter defines. See the page for your integration for them.

yaml
adapters:
  postgresql:
    source: git
    repository: "git+https://github.com/northgraindata/dsui"
    path: packages/adapter-postgresql

services:
  - id: app-database
    adapter: postgresql
    name: Application database
    connection:
      host: postgres
      database: app
      username: ${POSTGRES_USER}
      password: ${POSTGRES_PASSWORD}

The id must be lowercase letters, digits, and hyphens, and it must start with a letter. The name is optional and appears in the workspace.

Keep credentials out of the file#

DSUI replaces ${NAME} with the value of the environment variable NAME when it reads the file. If a variable is missing, DSUI stops with Configuration requires environment variable NAME. Set the variables in the environment of the DSUI process. In Docker Compose, add them under environment.

To avoid keeping the credentials in DSUI’s environment too, read them from a secret manager instead. See credentials from a secret manager.

Add a service in the workspace#

  1. Open the add-service page#

    From the dashboard, select Manage adapters, or search for Add service in the command palette.

  2. Choose the adapter and fill in the connection#

    Pick an adapter. Choose a Connection type if the adapter offers several, then fill in its fields. To reach a service in a private network, choose Via DSUI Agent and select an agent. See private networks.

  3. Test and save#

    Select Test connection. If it succeeds, select Save connection. If it fails, fix the fields and select Test again. After you save, select Open connection to open the service.

DSUI saves the connection encrypted with the master key. Keep the key safe, because DSUI can’t read saved connections without it. See saved connections can’t be decrypted.