Configure

Preparing dbui configuraiton file.

DBUI requires a configuration file to start. The file must be named dbui.yml and has the following structure:

dbui.yml
dataSources:
  - alias: employees
    type: mysql
    dsn: "root:demo@(localhost:3316)/employees"
  - alias: world-db
    type: postgresql
    dsn: "user=world password=world123 host=localhost port=5432 dbname=world-db sslmode=disable"
defaut: employees

For any given data source, DBUI requires three parameters:

  1. Alias - a user-defined name for a data source. It is shown in the UI as the name of the connection.

  2. Type - type of the databases. It is used to select a database driver.

  3. DSN - data source name. Check here and here for more information about DSNs. Provided DSN is used to establish a connection with the database. In case of a connection error, DBUI raises an error message.

Directory Specific Configuration

DBUI first checks in the current directory (./dbui.yml) for the configuration file during the application startup. You can use this feature to set a project-based database configuration file and isolate a different set of data sources from each other.

User Specific Configuration

If there is no configuration file in the current directory, DBUI will check in the user's home directory (~/dbui.yml).

Custom Configuration

Additionally, you can also provide a custom configuration file using the -f flag.

# run with a custom configuration file
dbui -f /my/custom/dir/dbui.yml

No Configuration

Please not that If you intent to start it without the configuration file it will raise the following error:

starting DBUI v<VERSION NUMBER> (<VERSION DATE>)
there is no `dbui.yml` file in the current (./dbui.yml) nor user directory (/root/dbui.yml)
create one or use `-dsn` and `-type` args

Last updated