@dypai-ai/client-sdk - v1.12.0
    Preparing search index...

    Class DataModule<TDatabase>

    Module for CRUD operations on database tables via the DYPAI API. Access it through client.db.

    For direct database access (bypassing endpoints/workflows), use client.db.direct — available when serviceRoleKey is provided to createClient().

    // Via endpoints (requires creating an endpoint + workflow)
    const { data } = await client.db.from('products').select();

    // Direct access (requires serviceRoleKey)
    const { data } = await client.db.direct.from('products').select();

    Type Parameters

    • TDatabase = any

      Optional type map of table names to row types for full type-safety.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get direct(): DirectDBModule<TDatabase>

      Direct database access — CRUD and raw SQL without endpoints/workflows.

      WARNING: This is admin-level access. Only use from server-side code (scripts, migrations, seeds, backend). NEVER expose the serviceRoleKey in client-side/browser code.

      Requires serviceRoleKey in createClient() config. Throws if not configured.

      Returns DirectDBModule<TDatabase>

    Methods