dab configure
修改现有配置文件中的运行时属性和数据源设置。实体相关的变更请使用 dab update。
语法
bash
dab configure [options]选项
基本
| 选项 | 说明 |
|---|---|
-c, --config | 配置文件路径 |
数据源选项
| 选项 | 说明 |
|---|---|
--data-source.database-type | 设置数据库类型:mssql、postgresql、mysql |
--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 | 认证提供程序:Unauthenticated、Custom、Simulator |
--runtime.host.authentication.jwt.audience | JWT audience |
--runtime.host.authentication.jwt.issuer | JWT issuer |
--runtime.host.cors.origins | CORS 来源(逗号分隔) |
--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.provider | L2 提供程序(redis) |
--runtime.cache.level-2.connection-string | L2 连接字符串 |
--runtime.cache.level-2.partition | L2 分区名 |
遥测与日志
| 选项 | 说明 |
|---|---|
--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"下一步
- dab update — 修改实体配置。
- dab validate — 验证配置正确性。
