Skip to content

Config File (.devdbrc) ​

Use a .devdbrc file when zero-config detection does not find your database.

Create the file ​

  1. Create a file with the name .devdbrc in the root of your workspace.
  2. Add a JSON array. Each item is one connection.
  3. Save the file. DevDb shows each connection under Config File in the DevDb panel.

WARNING

Add .devdbrc to .gitignore. The file can contain passwords. Each team member can then use a different configuration.

Editor help ​

The editor gives this help for .devdbrc:

  • Validation against the DevDb JSON schema.
  • Autocompletion for all keys, including type.
  • Snippets. Type the prefix, then press Tab:
PrefixInserts
devdb mysqlMySQL connection
devdb mariadbMariaDB connection
devdb postgresPostgreSQL connection
devdb sqliteSQLite file
devdb mssqlMicrosoft SQL Server connection
devdb duckdbDuckDB file

Rules ​

  • The file is JSON. Do not add comments.
  • A relative path is resolved from the folder that contains .devdbrc.
  • Each MySQL, MariaDB, PostgreSQL, SQL Server, Redis and ClickHouse entry needs a name.
  • Entries for Pro datastores (duckdb, redis, clickhouse) need a Pro license. Without a license, DevDb shows a warning and skips the entry.

Complete example ​

json
[
  {
    "name": "App (MySQL)",
    "type": "mysql",
    "host": "127.0.0.1",
    "port": 3306,
    "username": "root",
    "password": "secret",
    "database": "my_app"
  },
  {
    "type": "sqlite",
    "path": "database/database.sqlite"
  },
  {
    "name": "Cache",
    "type": "redis",
    "host": "127.0.0.1",
    "port": 6379
  }
]

Reference ​

This reference comes from the JSON schema schemas/devdbrc.json in the DevDb extension.

SQLite ​

KeyTypeRequiredDefaultDescription
type"sqlite"Yes—Database type
pathstringYes—Path to the SQLite database file. Relative to the .devdbrc folder.
json
[
  {
    "type": "sqlite",
    "path": "database/database.sqlite"
  }
]

MySQL / MariaDB ​

KeyTypeRequiredDefaultDescription
namestringYes—Name of the connection
type"mysql", "mariadb"Yes—Database type
hoststringNo"localhost"Database host
portnumberNo3306Database port
usernamestringYes—Database username
passwordstringYes—Database password. Use "" for no password.
databasestringYes—Database name
json
[
  {
    "name": "Shop (MariaDB)",
    "type": "mariadb",
    "host": "127.0.0.1",
    "port": 3306,
    "username": "shop",
    "password": "secret",
    "database": "shop"
  }
]

PostgreSQL ​

KeyTypeRequiredDefaultDescription
namestringYes—Name of the connection
type"postgres"Yes—Database type
hoststringNo"localhost"Database host
portnumberNo5432Database port
usernamestringYes—Database username
passwordstringYes—Database password
databasestringYes—Database name
json
[
  {
    "name": "Analytics (Postgres)",
    "type": "postgres",
    "host": "localhost",
    "port": 5432,
    "username": "postgres",
    "password": "secret",
    "database": "analytics"
  }
]

For a PostgreSQL server that needs TLS, use a remote connection.

Microsoft SQL Server ​

KeyTypeRequiredDefaultDescription
namestringYes—Name of the connection
type"mssql"Yes—Database type
hoststringNo"localhost"Database host
portnumberNo1433Database port
usernamestringYes—Database username
passwordstringYes—Database password
databasestringYes—Database name
optionsobjectNo—Driver options, for example trustServerCertificate
json
[
  {
    "name": "Legacy (SQL Server)",
    "type": "mssql",
    "host": "localhost",
    "port": 1433,
    "username": "sa",
    "password": "YourPassword123",
    "database": "master",
    "options": {
      "trustServerCertificate": true
    }
  }
]

Set trustServerCertificate to true for a local server with a self-signed certificate.

DuckDB Pro ​

KeyTypeRequiredDefaultDescription
type"duckdb"Yes—Database type
pathstringYes—Path to the DuckDB file. Relative to the .devdbrc folder.
readOnlybooleanNotrueOpen the file read-only. Set to false to allow writes.
json
[
  {
    "type": "duckdb",
    "path": "data/analytics.duckdb",
    "readOnly": true
  }
]

See DuckDB.

Redis / Valkey Pro ​

KeyTypeRequiredDefaultDescription
namestringYes—Name of the connection
type"redis"Yes—Redis or Valkey
connectionStringstringNo—redis:// or rediss:// (TLS) URL. When set, DevDb ignores host, port, username, password, database and tls.
hoststringNo"localhost"Server host
portnumberNo6379Server port
usernamestringNo—ACL username
passwordstringNo—Password
databasenumberNo0Database index
keyPrefixstringNo—Show only keys that start with this prefix
tlsbooleanNofalseConnect over TLS
json
[
  {
    "name": "Local Redis",
    "type": "redis",
    "host": "127.0.0.1",
    "port": 6379,
    "database": 0,
    "keyPrefix": "myapp:"
  },
  {
    "name": "Managed Valkey",
    "type": "redis",
    "connectionString": "rediss://default:[email protected]:6380/0"
  }
]

See Redis / Valkey.

ClickHouse Pro ​

KeyTypeRequiredDefaultDescription
namestringYes—Name of the connection
type"clickhouse"Yes—Database type
hoststringNo"localhost"Server host
portnumberNo8123HTTP(S) port
protocol"http", "https"NoSee belowTransport
usernamestringNo"default"Username
passwordstringNo—Password
databasestringNo"default"Database name

If you do not set protocol, DevDb uses https for port 8443 or 9440 and for all hosts that are not localhost. It uses http only for localhost, 127.0.0.1 and ::1.

json
[
  {
    "name": "Local ClickHouse",
    "type": "clickhouse",
    "host": "localhost",
    "port": 8123,
    "protocol": "http",
    "username": "default",
    "database": "default"
  },
  {
    "name": "ClickHouse Cloud",
    "type": "clickhouse",
    "host": "abc123.eu-west-1.aws.clickhouse.cloud",
    "port": 8443,
    "protocol": "https",
    "username": "default",
    "password": "secret"
  }
]

See ClickHouse.

Other connection types ​

These connection types are not available in .devdbrc. Add them from the DevDb panel, or let zero-config detection find them:

See Remote Connections.

DevDb - Zero-config database client for VS Code