Toshihiko
    Preparing search index...

    mysql2-backed Toshihiko Adapter.

    Queries are compiled as parameterized SQL. Reads can use a configured Cache; writes invalidate related cached rows before execution. Transaction methods acquire and release mysql2 Pool connections.

    Hierarchy (View Summary)

    Index
    database: string

    Configured database name.

    format: (sql: string, values?: MySQLValues) => string

    mysql2 SQL formatter bound to the underlying Pool.

    mysql: Pool

    Underlying mysql2 connection Pool.

    Mutable copy of Adapter-specific options.

    package: "mysql2" = 'mysql2'

    Driver package name retained for compatibility.

    parent: object | undefined

    Parent Toshihiko instance when constructed by Toshihiko.

    username: string

    Configured MySQL username.

    • Commits and releases a transaction connection.

      Parameters

      • connection: PoolConnection

      Returns Promise<void>

    • Formats an array of condition objects joined by the requested logic.

      Parameters

      • model: MySQLModel
      • condition: readonly Readonly<Record<string, DataValue>>[]
      • Optionallogic: string

      Returns string

    • Formats normalized limits as a MySQL LIMIT fragment body.

      Parameters

      • model: MySQLModel
      • limit: readonly (string | number)[]

      Returns string

    • Formats normalized sort entries as an ORDER BY fragment body.

      Parameters

      • model: MySQLModel
      • order: readonly Readonly<Record<string, number>>[]

      Returns string

    • Formats a complete Toshihiko condition as SQL.

      Parameters

      • model: MySQLModel
      • condition:
            | Readonly<Record<string, DataValue>>
            | readonly Readonly<Record<string, DataValue>>[]
      • Optionallogic: string

      Returns string

    • Rolls back and releases a transaction connection.

      Parameters

      • connection: PoolConnection

      Returns Promise<void>