Interface Explainable

Hierarchy

Implemented by

Methods

Methods

  • Executes query with explain statement before the main query.

    const explained = await db
    .selectFrom('person')
    .where('gender', '=', 'female')
    .selectAll()
    .explain('json')

    The generated SQL (MySQL):

    explain format=json select * from `person` where `gender` = ?
    

    You can also execute explain analyze statements.

    import { sql } from 'kysely'

    const explained = await db
    .selectFrom('person')
    .where('gender', '=', 'female')
    .selectAll()
    .explain('json', sql`analyze`)

    The generated SQL (PostgreSQL):

    explain (analyze, format json) select * from "person" where "gender" = $1
    

    Type Parameters

    • O extends Record<string, any> = Record<string, any>

    Parameters

    Returns Promise<O[]>

Generated using TypeDoc