Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SQLGrammarCompiler

This class is responsible for "compiling" QueryBuilders into the raw SQL that will be executed by the database engine. It returns both SQL and bound values, so we can safely let the database engine handle escaping of arguments.

Hierarchy

  • SQLGrammarCompiler

Index

Methods

compileAggregate

compileBasicWhere

compileColumnWhere

compileColumns

Protected compileComponents

  • compileComponents(builder: Builder): object
  • Compiles all components of a normal SELECT query. This can be overridden by subclasses to reorder this or to add/remove components.

    Parameters

    Returns object

compileConditions

compileDelete

compileFrom

compileGroups

compileInsert

  • Compiles a full INSERT query for the specified values. This accepts either a model or a keyed database value object. This assumes that every element in the values array has the same structure, and that it is not an empty array.

    Type parameters

    • T

    Parameters

    Returns QueryComponent

compileJoins

compileLimit

compileNestedWhere

compileNullWhere

compileOrders

compileRawWhere

compileSelect

compileUpdate

  • Compiles a full UPDATE query for the specified partial. This does not diff-check and simply assumes that everything specified needs to be updated.

    Type parameters

    • T

    Parameters

    Returns QueryComponent

compileWheres

Protected escapeColumn

  • escapeColumn(column: string): string
  • Escapes the specified column name. This is intended to be overridden by potential subclasses.

    Parameters

    • column: string

    Returns string

Protected escapeTable

  • escapeTable(table: string): string
  • Escapes the specified table name. This is intended to be overridden by potential subclasses.

    Parameters

    • table: string

    Returns string

Generated using TypeDoc