nb db check

Check whether a database is reachable. You can reuse the saved database settings from an env or pass explicit --db-* flags.

Usage

nb db check [flags]

Parameters

ParameterTypeDescription
--env, -estringRead database settings from a CLI env; when omitted, all required --db-* flags must be provided
--db-dialectstringDatabase dialect: postgres, kingbase, mysql, or mariadb
--db-hoststringDatabase host name or IP address
--db-portstringDatabase TCP port
--db-databasestringDatabase name
--db-userstringDatabase username
--db-passwordstringDatabase password
--jsonbooleanOutput JSON

Examples

nb db check --env app1
nb db check --env app1 --db-password new-secret --json
nb db check --db-dialect postgres --db-host 127.0.0.1 --db-port 5432 --db-database nocobase --db-user nocobase --db-password secret

Notes

If the selected env uses a CLI-managed built-in database, the CLI resolves the actual connection address before running the check.