For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/reference/sdk/sapi/db/functions/createDbClient.md.
  • English
  • Function: createDbClient()

    function createDbClient(moduleId: string, token: string): DbClient;

    Defined in: sapi/db/client.ts:117

    创建绑定到指定模块身份的数据库客户端(推荐路径)。 事务 _currentTxId 仅存在于本闭包,不会全局互斥其它模块的 query/tx。

    Parameters

    ParameterType
    moduleIdstring
    tokenstring

    Returns

    DbClient