Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IDbSqlOperations

Defines SQL operations.

Hierarchy

Implemented by

Index

Methods

iquery

  • Execute an SQL query defined by the given query builder and retrieve the results iteratively.

    Use the predefined query builder functions SQL or RAW to formulate your parameterized SQL query.

    The result can be iterated one by one or in batches to avoid memory overrun when the result contains a large number of rows. Usually, this is implemented by using a cursor. The fetch size of the cursor can be adjusted in the specified query options.

    Returns a promise that if fulfilled yields an iterator for iterating the resulting row data. The promise is rejected if an error occurs.

    If you know that a query only returns a very limited number of rows, it might be more convenient to use the query operation to retrieve all rows at once.

    Note that the iquery operation might not be supported by a specific database adapter. In this case, the returned promise yields an "operation not supported" error.

    Parameters

    Returns Promise<IQueryIterator<any>>

query

  • Execute an SQL query defined by the given query builder and retrieve the results as one set of row data.

    Use the predefined query builder functions SQL or RAW to formulate your parameterized SQL query.

    Returns a promise that if fulfilled yields all the query results as one set of row data. The promise is rejected if the query yields an error.

    Note that the query first retrieves all result rows and stores them in memory. For queries that have potentially large result sets, consider to use the iquery operation instead of this one.

    Parameters

    Returns Promise<SqlQueryResultSet>

Generated using TypeDoc