Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OrmService

High level abstraction as ORM service around Typeorm better-sqlite3 driver.

Hierarchy

  • OrmService

Index

Properties

Private con

con: Connection

Methods

dbCheckpoint

  • dbCheckpoint(): void

execute

  • execute<T>(query: string): Promise<T[]>
  • Execute raw sql query and get list of objects with type T

    Type parameters

    • T

    Parameters

    • query: string

    Returns Promise<T[]>

getRaw

  • getRaw<T>(query: string): Promise<T[]>
  • [DEPRECATED] Execute raw sql query and get list of objects with type T

    Type parameters

    • T

    Parameters

    • query: string

    Returns Promise<T[]>

getRepo

  • getRepo<T>(v: ObjectType<T> | EntitySchema<T> | string): Repository<T>
  • Get Typeorm repository by type

    Type parameters

    • T

    Parameters

    • v: ObjectType<T> | EntitySchema<T> | string

    Returns Repository<T>

Private updateDriver

  • updateDriver(con: Connection): Promise<Connection>

useConnection

  • useConnection(con: Connection): Promise<Connection>
  • Initialize connection and replace default SQLite driver (sqlite3) to better-sqlite3

    Parameters

    • con: Connection

    Returns Promise<Connection>