Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataContext

This is the main interface to the ORM. It provides access to CRUD operations and connection management.

Hierarchy

Index

Constructors

constructor

Properties

Protected colStore

colStore: ColumnStore

Protected propStore

propStore: PropertyMapStore

Protected relStore

Protected tblStore

tblStore: TableStore

Methods

Abstract beginTransaction

  • beginTransaction<C, P, R>(transFunc: function): Promise<R>
  • Begin a transaction.

    Type parameters

    • C

      Connection type for the underlying database driver.

    • P

      Pool type for the underlying database driver.

    • R

      transFunc shall be resolved with type R, and this function will proxy the return when transFunc completes.

    Parameters

    • transFunc: function

      A user-supplied function that will be called with a DataContext instance. All queries executed against the DataContext will be part of the transaction. The user-supplied function should return a promise. If that promise is resolved then the transaction will be committed, otherwise it will be rolled back. The return of transFunc is returned from beginTransaction.

    Returns Promise<R>

    A promise that will be rejected if there is an error when beginning the transaction.

Abstract connect

delete

Abstract end

  • end(): Promise<void>

Abstract from

Abstract getEscaper

Abstract getExecuter

insert

rollbackTransaction

  • rollbackTransaction(): Promise<void>

Abstract update

Generated using TypeDoc