Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DatabaseEngine

Represents an engine for an SQL-based database.

Hierarchy

  • DatabaseEngine

Implemented by

Index

Methods

get

  • Runs the specified query against the database and returns the result as an array of objects of format { columnName: value }.

    Parameters

    • sql: string

      The SQL to execute. ? is used as placeholder for bound values.

    • params: DatabaseType[]

      The parameters, which should replace the '?' placeholders.

    Returns Promise<KeyedDatabaseResult[]>

getGrammarCompiler

  • Returns the SQLGrammarCompiler responsible for compiling QueryBuilders into actual SQL queries. This may be a raw SQLGrammarCompiler or a subclass for database-specific minor changes to the queries.

    Returns SQLGrammarCompiler

insertAndGetId

  • insertAndGetId(table: string, sql: string, params: DatabaseType[]): Promise<number>
  • Runs the specified insert query and returns the ID of the inserted row.

    Parameters

    Returns Promise<number>

query

  • Runs the specified query against the database and voids the results (if any).

    Parameters

    • sql: string

      The SQL to execute. ? is used as placeholder for bound values.

    • params: DatabaseType[]

      The parameters, which should replace the '?' placeholders.

    Returns Promise<void>

Generated using TypeDoc