For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/sdk/sapi/db/index.md.
  • 简体中文
  • sapi/db

    Functions

    FunctionDescription
    createDbClientdb/index.ts — @sfmc-bds/sdk/sapi/db 公开 API
    setDbModuleContextdb/index.ts — @sfmc-bds/sdk/sapi/db 公开 API
    getDbClientdb/index.ts — @sfmc-bds/sdk/sapi/db 公开 API
    clearDbModuleContextdb/index.ts — @sfmc-bds/sdk/sapi/db 公开 API
    isDbTxRecordingdb/index.ts — @sfmc-bds/sdk/sapi/db 公开 API

    Classes

    ClassDescription
    DbError数据库客户端异常(包含服务端返回的业务 code 与 HTTP status)。

    Interfaces

    InterfaceDescription
    TxContext交互式事务上下文(db.tx / DbClient.tx 回调参数)。
    DbClient作用域数据库客户端:moduleId/token 与事务状态均封闭在实例内, 多模块打包进同一 SAPI 运行时可安全并发。
    ColumnDef表列定义(由 defineTable 注册)。
    QueryOptions查询选项(WHERE / ORDER BY / 分页)。
    InsertResult插入成功响应。
    UpdateResult更新成功响应。
    DeleteResult删除成功响应。
    TxStepResult单步事务执行结果。
    TxResponse批量事务成功响应。
    TxError事务失败响应。
    DefineTableRequestdefineTable 请求体。
    DefineTableResponsedefineTable 成功响应。

    Type Aliases

    Type AliasDescription
    ColumnTypeSQLite 列类型白名单。
    PrimitiveWHERE 表达式可用的原始值类型。
    WhereExpr白名单 WHERE 表达式树(平台翻译为 SQL,禁止手写 SQL)。
    OrderBy排序字段与方向。
    TxStep批量事务单步操作(也用于交互式 tx step)。

    Variables

    VariableDescription
    dbSAPI 侧数据库门面(兼容单例):转发到当前激活的作用域客户端。
    SFMC_SAPI_DB_VERSION@sfmc-bds/sdk/sapi/db 子路径 semver 版本号。