Polyglot SQL API Documentation - v0.1.0
    Preparing search index...

    Class SelectBuilder

    Fluent builder for SELECT queries.

    const sql = select('id', 'name')
    .from('users')
    .where(col('status').eq(lit('active')))
    .orderBy(col('name').asc())
    .limit(10)
    .toSql('postgresql');
    Index

    Constructors

    Methods

    • Return the Expression AST as a plain JS object.

      Returns any

    • Add a CROSS JOIN.

      Parameters

      • tableName: string

      Returns this

    • Add FOR UPDATE locking.

      Returns this

    • Free the underlying WASM handle.

      Returns void

    • Set the FROM clause.

      Parameters

      • tableOrExpr: string | Expr

      Returns this

    • Set the LIMIT.

      Parameters

      • n: number

      Returns this

    • Set the OFFSET.

      Parameters

      • n: number

      Returns this

    • Add columns to the SELECT list. Accepts Expr, strings (→ col), or '*'.

      Parameters

      Returns this

    • Generate SQL string. Defaults to generic dialect.

      Parameters

      • dialect: string = 'generic'

      Returns string