zol
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

AggrCols

AggrCols: object

Type declaration

LeftCols

LeftCols: object

Type declaration

MakeCols

MakeCols: object

Type declaration

MakeTable

MakeTable: object & object

TableDeclareCols

TableDeclareCols: object

Type declaration

Functions

aggregate

  • aggregate<s, a>(q: Q<s>, s: function): MakeCols<s, a>
  • Type parameters

    • s

    • a: any

    Parameters

    Returns MakeCols<s, a>

arbitrary

  • Type parameters

    • s

    Returns Col<s, Arbitrary>

avg

  • avg<s>(col: Col<s, number>): Aggr<s, number | null>
  • Type parameters

    • s

    Parameters

    • col: Col<s, number>

    Returns Aggr<s, number | null>

booleanCol

  • booleanCol<s>(val: boolean): Col<s, boolean>
  • Type parameters

    • s

    Parameters

    • val: boolean

    Returns Col<s, boolean>

count

  • count<s, a>(col: Col<s, a>): Aggr<s, number>
  • Type parameters

    • s

    • a

    Parameters

    • col: Col<s, a>

    Returns Aggr<s, number>

declareTable

  • Type parameters

    • Req: any

    • Def: any

    Parameters

    Returns Table<Req, Def>

defaultValue

delete_

  • delete_<Req, Def>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, pred: function): Promise<number>
  • Type parameters

    • Req: any

    • Def: any

    Parameters

    Returns Promise<number>

    number of rows deleted

distinct

  • distinct<s, a>(q: Q<s>, query: function): MakeCols<s, a>
  • Type parameters

    • s

    • a: any

    Parameters

    Returns MakeCols<s, a>

e

  • e<s, a>(lhs: Col<s, a>, op: "=", rhs: Col<s, a>): Col<s, boolean>
  • e<s, a>(lhs: Col<s, a>, op: "!=", rhs: Col<s, a>): Col<s, boolean>
  • e<s, a>(lhs: Col<s, a>, op: ">", rhs: Col<s, a>): Col<s, boolean>
  • e<s, a>(lhs: Col<s, a>, op: "<", rhs: Col<s, a>): Col<s, boolean>
  • e<s, a>(lhs: Col<s, a>, op: ">=", rhs: Col<s, a>): Col<s, boolean>
  • e<s, a>(lhs: Col<s, a>, op: "<=", rhs: Col<s, a>): Col<s, boolean>
  • e<s>(lhs: Col<s, boolean>, op: "AND", rhs: Col<s, boolean>): Col<s, boolean>
  • e<s>(lhs: Col<s, boolean>, op: "OR", rhs: Col<s, boolean>): Col<s, boolean>
  • e<s>(lhs: Col<s, number>, op: "+", rhs: Col<s, number>): Col<s, number>
  • e<s>(lhs: Col<s, number>, op: "-", rhs: Col<s, number>): Col<s, number>
  • e<s>(lhs: Col<s, number>, op: "*", rhs: Col<s, number>): Col<s, number>
  • e<s>(lhs: Col<s, number>, op: "/", rhs: Col<s, number>): Col<s, number>
  • e<s>(lhs: Col<s, string>, op: "||", rhs: Col<s, string>): Col<s, string>
  • Type parameters

    • s

    • a

    Parameters

    • lhs: Col<s, a>
    • op: "="
    • rhs: Col<s, a>

    Returns Col<s, boolean>

  • Type parameters

    • s

    • a

    Parameters

    • lhs: Col<s, a>
    • op: "!="
    • rhs: Col<s, a>

    Returns Col<s, boolean>

  • Type parameters

    • s

    • a

    Parameters

    • lhs: Col<s, a>
    • op: ">"
    • rhs: Col<s, a>

    Returns Col<s, boolean>

  • Type parameters

    • s

    • a

    Parameters

    • lhs: Col<s, a>
    • op: "<"
    • rhs: Col<s, a>

    Returns Col<s, boolean>

  • Type parameters

    • s

    • a

    Parameters

    • lhs: Col<s, a>
    • op: ">="
    • rhs: Col<s, a>

    Returns Col<s, boolean>

  • Type parameters

    • s

    • a

    Parameters

    • lhs: Col<s, a>
    • op: "<="
    • rhs: Col<s, a>

    Returns Col<s, boolean>

  • Type parameters

    • s

    Parameters

    • lhs: Col<s, boolean>
    • op: "AND"
    • rhs: Col<s, boolean>

    Returns Col<s, boolean>

  • Type parameters

    • s

    Parameters

    • lhs: Col<s, boolean>
    • op: "OR"
    • rhs: Col<s, boolean>

    Returns Col<s, boolean>

  • Type parameters

    • s

    Parameters

    • lhs: Col<s, number>
    • op: "+"
    • rhs: Col<s, number>

    Returns Col<s, number>

  • Type parameters

    • s

    Parameters

    • lhs: Col<s, number>
    • op: "-"
    • rhs: Col<s, number>

    Returns Col<s, number>

  • Type parameters

    • s

    Parameters

    • lhs: Col<s, number>
    • op: "*"
    • rhs: Col<s, number>

    Returns Col<s, number>

  • Type parameters

    • s

    Parameters

    • lhs: Col<s, number>
    • op: "/"
    • rhs: Col<s, number>

    Returns Col<s, number>

  • Type parameters

    • s

    Parameters

    • lhs: Col<s, string>
    • op: "||"
    • rhs: Col<s, string>

    Returns Col<s, string>

exists

  • exists<s>(subquery: function): Col<s, boolean>
  • Type parameters

    • s

    Parameters

    Returns Col<s, boolean>

groupBy

  • Type parameters

    • s

    • a

    Parameters

    Returns Aggr<Inner<s>, a>

ifNull

  • ifNull<s, a>(replacement: Col<s, a>, nullable: Col<s, a | null>): Col<s, a>
  • Type parameters

    • s

    • a

    Parameters

    • replacement: Col<s, a>
    • nullable: Col<s, a | null>

    Returns Col<s, a>

ifThenElse

  • ifThenElse<s, a>(if_: Col<s, boolean>, then: Col<s, a>, else_: Col<s, a>): Col<s, a>
  • Type parameters

    • s

    • a

    Parameters

    • if_: Col<s, boolean>
    • then: Col<s, a>
    • else_: Col<s, a>

    Returns Col<s, a>

ilike

  • ilike<s>(str: Col<s, string>, pattern: string): Col<s, boolean>
  • ilike<s>(str: Col<s, string>, pattern: Col<s, string>): Col<s, boolean>
  • Type parameters

    • s

    Parameters

    • str: Col<s, string>
    • pattern: string

    Returns Col<s, boolean>

  • Type parameters

    • s

    Parameters

    • str: Col<s, string>
    • pattern: Col<s, string>

    Returns Col<s, boolean>

inList

  • inList<s, a>(lhs: Col<s, a>, rhs: Col<s, a>[]): Col<s, boolean>
  • Type parameters

    • s

    • a

    Parameters

    • lhs: Col<s, a>
    • rhs: Col<s, a>[]

    Returns Col<s, boolean>

inQuery

  • inQuery<s, a>(lhs: Col<s, a>, rhs: function): Col<s, boolean>
  • Type parameters

    • s

    • a

    Parameters

    • lhs: Col<s, a>
    • rhs: function
        • (q: Q<s>): Col<s, a>
        • Parameters

          • q: Q<s>

          Returns Col<s, a>

    Returns Col<s, boolean>

inner

  • inner<s, a>(q: Q<s>, query: function): MakeCols<s, a>

innerJoin

  • innerJoin<s, a>(q: Q<s>, s: function, pred: function): MakeCols<s, a>

insert

  • insert<Req, Def>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>): Promise<void>
  • Type parameters

    • Req: any

    • Def: any

    Parameters

    • sqlTag: string | undefined
    • conn: Client
    • table: Table<Req, Def>
    • rowValues: MakeTable<Req, Def>

    Returns Promise<void>

insertMany

  • insertMany<Req, Def>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>[]): Promise<void>
  • Type parameters

    • Req: any

    • Def: any

    Parameters

    • sqlTag: string | undefined
    • conn: Client
    • table: Table<Req, Def>
    • rowValues: MakeTable<Req, Def>[]

    Returns Promise<void>

insertManyOnConflictDoNothing

  • insertManyOnConflictDoNothing<Req, Def>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>[], conflictTarget: ConflictTarget<Req & Def>): Promise<number>
  • Type parameters

    • Req: any

    • Def: any

    Parameters

    Returns Promise<number>

    The number of rows inserted

insertManyOnConflictDoNothingReturning

  • insertManyOnConflictDoNothingReturning<Req, Def, Ret>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>[], conflictTarget: ConflictTarget<Req & Def>, returning: function): Promise<Ret[]>

insertManyOnConflictDoUpdate

  • insertManyOnConflictDoUpdate<Req, Def>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>[], conflictTarget: ConflictTarget<Req & Def>, onConflictPred: function, onConflictUpdate: function): Promise<number>
  • Type parameters

    • Req: any

    • Def: any

    Parameters

    Returns Promise<number>

    The number of newly inserted rows + the number of updated rows

insertManyOnConflictDoUpdateReturning

  • insertManyOnConflictDoUpdateReturning<Req, Def, Ret>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>[], conflictTarget: ConflictTarget<Req & Def>, onConflictPred: function, onConflictUpdate: function, returning: function): Promise<Ret[]>

insertManyReturning

  • insertManyReturning<Req, Def, Ret>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>[], returning: function): Promise<Ret[]>
  • Type parameters

    • Req: any

    • Def: any

    • Ret: any

    Parameters

    Returns Promise<Ret[]>

insertOnConflictDoNothing

  • insertOnConflictDoNothing<Req, Def>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>, conflictTarget: ConflictTarget<Req & Def>): Promise<boolean>
  • Type parameters

    • Req: any

    • Def: any

    Parameters

    Returns Promise<boolean>

    true if the row was inserted

insertOnConflictDoNothingReturning

  • insertOnConflictDoNothingReturning<Req, Def, Ret>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>, conflictTarget: ConflictTarget<Req & Def>, returning: function): Promise<Ret>

insertOnConflictDoUpdate

  • insertOnConflictDoUpdate<Req, Def>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>, conflictTarget: ConflictTarget<Req & Def>, onConflictPred: function, onConflictUpdate: function): Promise<boolean>
  • Type parameters

    • Req: any

    • Def: any

    Parameters

    Returns Promise<boolean>

    If a new row was inserted returns true.

        If a conflicting row already existed but was updated returns true.
    
        If a conflicting row already existed and was not updated returns false.

insertOnConflictDoUpdateReturning

  • insertOnConflictDoUpdateReturning<Req, Def, Ret>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>, conflictTarget: ConflictTarget<Req & Def>, onConflictPred: function, onConflictUpdate: function, returning: function): Promise<Ret>

insertReturning

  • insertReturning<Req, Def, Ret>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, rowValues: MakeTable<Req, Def>, returning: function): Promise<Ret>
  • Type parameters

    • Req: any

    • Def: any

    • Ret: any

    Parameters

    Returns Promise<Ret>

isNotNull

  • isNotNull<s, a>(col: Col<s, a | null>): Col<s, boolean>
  • Type parameters

    • s

    • a

    Parameters

    • col: Col<s, a | null>

    Returns Col<s, boolean>

isNull

  • isNull<s, a>(col: Col<s, a | null>): Col<s, boolean>
  • Type parameters

    • s

    • a

    Parameters

    • col: Col<s, a | null>

    Returns Col<s, boolean>

leftJoin

  • leftJoin<s, a>(q: Q<s>, s: function, pred: function): LeftCols<s, a>

like

  • like<s>(str: Col<s, string>, pattern: string): Col<s, boolean>
  • like<s>(str: Col<s, string>, pattern: Col<s, string>): Col<s, boolean>
  • Type parameters

    • s

    Parameters

    • str: Col<s, string>
    • pattern: string

    Returns Col<s, boolean>

  • Type parameters

    • s

    Parameters

    • str: Col<s, string>
    • pattern: Col<s, string>

    Returns Col<s, boolean>

limit

  • limit<s, a>(q: Q<s>, from: number, to: number, query: function): MakeCols<s, a>

matchNull

  • matchNull<s, s2, a, b>(nullable: Col<s, a | null>, replacement: Col<s, b>, f: function): Col<s, b>
  • Type parameters

    • s

    • s2

    • a

    • b

    Parameters

    • nullable: Col<s, a | null>
    • replacement: Col<s, b>
    • f: function
        • (col: Col<s2, a>): Col<s2, b>
        • Parameters

          • col: Col<s2, a>

          Returns Col<s2, b>

    Returns Col<s, b>

max

  • max<s, a>(col: Col<s, a>): Aggr<s, a | null>
  • Type parameters

    • s

    • a

    Parameters

    • col: Col<s, a>

    Returns Aggr<s, a | null>

min

  • min<s, a>(col: Col<s, a>): Aggr<s, a | null>
  • Type parameters

    • s

    • a

    Parameters

    • col: Col<s, a>

    Returns Aggr<s, a | null>

not

  • not<s, a>(col: Col<s, a | null>): Col<s, boolean>
  • Type parameters

    • s

    • a

    Parameters

    • col: Col<s, a | null>

    Returns Col<s, boolean>

nullCol

  • nullCol<s>(): Col<s, null>
  • Type parameters

    • s

    Returns Col<s, null>

numberCol

  • numberCol<s>(val: number): Col<s, number>
  • Type parameters

    • s

    Parameters

    • val: number

    Returns Col<s, number>

order

  • order<s, a>(q: Q<s>, col: Col<s, a>, order: Order): void
  • Type parameters

    • s

    • a

    Parameters

    Returns void

query

  • query<t>(sqlTag: string | undefined, conn: Client, q: function): Promise<t[]>
  • Type parameters

    • t: any

    Parameters

    • sqlTag: string | undefined
    • conn: Client
    • q: function

    Returns Promise<t[]>

queryOne

  • queryOne<t>(sqlTag: string | undefined, conn: Client, q: function): Promise<t>
  • Type parameters

    • t: any

    Parameters

    • sqlTag: string | undefined
    • conn: Client
    • q: function

    Returns Promise<t>

queryOneOrNone

  • queryOneOrNone<t>(sqlTag: string | undefined, conn: Client, q: function): Promise<t | null>
  • Type parameters

    • t: any

    Parameters

    • sqlTag: string | undefined
    • conn: Client
    • q: function

    Returns Promise<t | null>

queryStreaming

  • queryStreaming<t>(sqlTag: string | undefined, conn: Client, q: function, rowChunkSize?: number): Promise<StreamingRows<t>>
  • Type parameters

    • t: any

    Parameters

    • sqlTag: string | undefined
    • conn: Client
    • q: function
    • Optional rowChunkSize: number

    Returns Promise<StreamingRows<t>>

restrict

  • restrict<s>(q: Q<s>, expr: Col<s, boolean>): void
  • Type parameters

    • s

    Parameters

    • q: Q<s>
    • expr: Col<s, boolean>

    Returns void

restrictEq

  • restrictEq<s, a>(q: Q<s>, lhs: Col<s, a>, rhs: Col<s, a>): void
  • Type parameters

    • s

    • a

    Parameters

    • q: Q<s>
    • lhs: Col<s, a>
    • rhs: Col<s, a>

    Returns void

select

  • Type parameters

    • s

    • a: any

    • b: any

    Parameters

    Returns MakeCols<s, a & b>

selectValues

  • Type parameters

    • s

    • a: any

    Parameters

    Returns MakeCols<s, a>

suchThat

  • suchThat<s, a>(q: Q<s>, query: function, pred: function): MakeCols<s, a>

sum

  • sum<s>(col: Col<s, number>): Aggr<s, number>
  • Type parameters

    • s

    Parameters

    • col: Col<s, number>

    Returns Aggr<s, number>

textCol

  • textCol<s>(str: string): Col<s, string>
  • Type parameters

    • s

    Parameters

    • str: string

    Returns Col<s, string>

update

  • update<Req, Def>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, pred: function, upd: function): Promise<number>

updateReturning

  • updateReturning<Req, Def, Ret>(sqlTag: string | undefined, conn: Client, table: Table<Req, Def>, pred: function, upd: function, returning: function): Promise<Ret[]>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc