nb db check

检查数据库是否可达。可以复用已保存 env 的数据库配置,也可以显式传入 --db-* 参数。

用法

nb db check [flags]

参数

参数类型说明
--env, -estring从指定 CLI env 读取数据库配置;省略时需要显式提供全部 --db-* 参数
--db-dialectstring数据库方言:postgreskingbasemysqlmariadb
--db-hoststring数据库主机名或 IP
--db-portstring数据库端口
--db-databasestring数据库名
--db-userstring数据库用户名
--db-passwordstring数据库密码
--jsonboolean输出 JSON

示例

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

说明

如果指定的 env 使用 CLI 托管的内置数据库,CLI 会自动解析实际连接地址后再进行检测。

相关命令