Options
All
  • Public
  • Public/Protected
  • All
Menu

Implementation of the abstract builder class that returns simple QueryRow objects.

Hierarchy

Index

Constructors

constructor

Properties

Protected constraints

constraints: Constraint[] = []

Constraints applied to this query.

Protected Readonly databaseService

databaseService: DatabaseService

Protected Optional rawSql

rawSql: string

Raw SQL to use instead. Overrides builder methods.

Protected Optional registeredConnection

registeredConnection: Connection

The connection on which the query should be executed.

Protected registeredDistinct

registeredDistinct: boolean = false

If true, the query should refer to distinct records.

Protected registeredFields

registeredFields: SpecifiedField[] = []

The fields to query from the table.

Protected registeredGroupings

registeredGroupings: string[] = []

Array of SQL group-by clauses.

Protected registeredOrders

registeredOrders: OrderStatement[] = []

Array of SQL order-by clauses.

Protected Optional registeredSkip

registeredSkip: number

The number of records to skip before the result set.

Protected Optional registeredTake

registeredTake: number

The max number of records to include in the result set.

Protected Optional source

source: QuerySource

The source table to query from.

Accessors

Private appClassApplication

appliedConstraints

appliedDistinction

  • get appliedDistinction(): boolean

appliedFields

appliedGroupings

  • get appliedGroupings(): string[]

appliedOrder

appliedPagination

  • get appliedPagination(): { skip: undefined | number; take: undefined | number }
  • Get the skip/take values of this query.

    Returns { skip: undefined | number; take: undefined | number }

    • skip: undefined | number
    • take: undefined | number

appliedRawSql

  • get appliedRawSql(): Maybe<string>

querySource

Methods

Protected app

clearFields

clone

connection

Protected container

delete

distinct

exists

  • exists(): Promise<boolean>

field

fields

finalize

first

  • first(): Promise<undefined | QueryRow>

from

  • from(table: string, alias?: string): Builder

get

getBoundMethod

  • getBoundMethod(methodName: string): (...args: any[]) => any
  • Get the method with the given name from this class, bound to this class.

    Parameters

    • methodName: string

    Returns (...args: any[]) => any

    function

      • (...args: any[]): any
      • Parameters

        • Rest ...args: any[]

        Returns any

getNewInstance

getResultIterable

groupBy

  • groupBy(...groupings: string[]): Builder

insert

  • Insert the given rows into the table for this query, returning the fields specified in this query.

    example
    const rows = [
     { name: 'A' },
     { name: 'B' },
    ]
    
    query.table('my_table')
     .returning('id', 'name')
     .insert(rows)
    

    This is equivalent to:

    INSERT INTO my_table (name)
    VALUES ('A'), ('B')
    RETURNING id, name
    

    Parameters

    • rowOrRows: {} | {}[]

    Returns Promise<QueryResult>

iterator

limit

Protected make

  • make<T>(target: any, ...parameters: any[]): T

notDistinct

offset

orWhere

orWhereIn

orWhereNot

orWhereNotIn

orWhereRaw

orderBy

orderByAscending

  • orderByAscending(field: string): Builder

orderByDescending

  • orderByDescending(field: string): Builder

page

  • page(pageNum?: number, pageSize?: number): Builder

raw

returning

select

skip

table

  • table(table: string, alias?: string): Builder

take

update

where

whereIn

whereNot

whereNotIn

whereRaw

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.