Skip to content

dab configure

修改现有配置文件中的运行时属性和数据源设置。实体相关的变更请使用 dab update

语法

bash
dab configure [options]

选项

基本

选项说明
-c, --config配置文件路径

数据源选项

选项说明
--data-source.database-type设置数据库类型:mssqlpostgresqlmysql
--data-source.connection-string设置数据库连接字符串
--data-source.options.set-session-context启用/禁用 SQL Server session context

REST 运行时

选项说明
--runtime.rest.enabled启用/禁用 REST(true / false
--runtime.rest.path设置 REST 端点路径前缀
--runtime.rest.request-body-strict启用/禁用严格请求体校验

GraphQL 运行时

选项说明
--runtime.graphql.enabled启用/禁用 GraphQL(true / false
--runtime.graphql.path设置 GraphQL 端点路径
--runtime.graphql.allow-introspection启用/禁用架构内省
--runtime.graphql.depth-limit设置查询最大嵌套深度
--runtime.graphql.multiple-mutations.create.enabled启用/禁用多重创建变更

主机与认证

选项说明
--runtime.host.mode运行模式:Development / Production
--runtime.host.authentication.provider认证提供程序:UnauthenticatedCustomSimulator
--runtime.host.authentication.jwt.audienceJWT audience
--runtime.host.authentication.jwt.issuerJWT issuer
--runtime.host.cors.originsCORS 来源(逗号分隔)
--runtime.host.cors.allow-credentials是否允许 CORS 凭据

分页

选项说明
--runtime.pagination.default-page-size默认每页记录数
--runtime.pagination.max-page-size最大每页记录数

MCP 运行时

选项说明
--runtime.mcp.enabled启用/禁用 MCP
--runtime.mcp.path设置 MCP 端点路径
--runtime.mcp.dml-tools.<tool-name>逐个控制 DML 工具开关
--runtime.mcp.dml-tools.aggregate-records.query-timeout聚合查询超时(1–600 秒)

缓存

选项说明
--runtime.cache.enabled启用/禁用全局缓存
--runtime.cache.ttl-seconds设置默认缓存 TTL
--runtime.cache.level-2.enabled启用/禁用 L2 缓存
--runtime.cache.level-2.providerL2 提供程序(redis
--runtime.cache.level-2.connection-stringL2 连接字符串
--runtime.cache.level-2.partitionL2 分区名

遥测与日志

选项说明
--runtime.telemetry.log-level.default默认日志级别
--runtime.telemetry.log-level.<namespace>命名空间特定日志级别
--runtime.telemetry.file.enabled启用文件日志
--runtime.telemetry.file.path日志文件路径

健康检查

选项说明
--runtime.health.enabled启用/禁用健康检查端点
--runtime.health.roles允许访问 /health 的角色(逗号分隔)
--runtime.health.cache-ttl-seconds健康结果缓存 TTL
--runtime.health.max-query-parallelism最大并发健康检查数(1–8)

特殊命令

选项说明
--show-effective-permissions显示继承应用后每个实体的最终解析权限

示例

配置数据源

bash
dab configure \
  --data-source.database-type "mssql" \
  --data-source.connection-string "@env('SQL_CONN_STR')"

配置 JWT 认证

bash
dab configure \
  --runtime.host.authentication.provider "Custom" \
  --runtime.host.authentication.jwt.issuer "https://idp.example.com/" \
  --runtime.host.authentication.jwt.audience "api://dab-api"

关闭 GraphQL 内省

bash
dab configure --runtime.graphql.allow-introspection false

查看有效权限

bash
dab configure --show-effective-permissions

设置运行模式

bash
dab configure --runtime.host.mode "development"

下一步

数据墙DBW 产品文档与开发指南。