Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Insert<T>

A Query class that represents an INSERT query. Instances of the class can be used to insert models in a database.

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

Properties

Protected colStore

colStore: ColumnStore

Used for accessing columns in tables.

Protected escaper

escaper: Escaper

An Escaper matching the database type (e.g. MySQLEscaper or MSSQLEscaper). Used when escaping column names in compiled conditions.

Protected executer

executer: Executer

An Executer instance that matches the database type (e.g. MySQLExecuter).

Protected tblStore

tblStore: TableStore

Used for accessing tables in the database.

Methods

buildQuery

execute

  • execute(): Promise<T>
  • Execute the query.

    Returns Promise<T>

    A Promise that shall be resolved with the model. If the Executer.insert operation returns a generated insertId the model will be updated with that ID. If an error occurs during execution the promise shall be rejected with the unmodified error.

toString

  • toString(): string

Generated using TypeDoc