• Public
  • Public/Protected
  • All

Module to export all public Unified Storage APIs for db-agnostic schemaless storage of objects.


Type aliases


AggregateProperties: string | string[]

Defines the format of nested properties used for aggregating objects. Both dot notation ("property.subproperty.subsubproperty") and array notation (["property", "subproperty", "subsubproperty"]) are supported for naming nested properties. Note that dot notation cannot be used if one of the properties contains a dot (.) in its name. In such cases, array notation must be used.


DbAdapterExtension: (...args: any) => Promise<any>

Type declaration

    • (...args: any): Promise<any>
    • Parameters

      • Rest ...args: any

      Returns Promise<any>


IDbAdapterConstructor: new (connectionInfo: DbConnectionInfo) => IDbAdapter & IDbAdapterExtension

Type declaration


SqlQueryBuilder: (placeholder: string, appendIndex: boolean, startIndex: number, asIdentifier: (id: string) => string, asLiteral: (literal: string) => string, embedParams?: boolean) => [string, any[]]

Type declaration

    • (placeholder: string, appendIndex: boolean, startIndex: number, asIdentifier: (id: string) => string, asLiteral: (literal: string) => string, embedParams?: boolean): [string, any[]]
    • A universal SQL query builder function to be called by a specific database adapter to yield a database specific SQL query tuple, consisting of a parameterized SQL query text and an array of bound parameter values.

      The DB API provides two predefined functions that create and return SQL query builder functions: SQL and RAW.


      • placeholder: string
      • appendIndex: boolean
      • startIndex: number
      • asIdentifier: (id: string) => string
          • (id: string): string
          • Parameters

            • id: string

            Returns string

      • asLiteral: (literal: string) => string
          • (literal: string): string
          • Parameters

            • literal: string

            Returns string

      • Optional embedParams: boolean

      Returns [string, any[]]



  • Use this function to build a query from raw text and the given bound parameters. Raw text has SQL placeholders already in place. No substitutions take place; the text is passed to the database as is.

    Use of the SQL tag function is preferred over RAW, because RAW SQL text is database specific due to the non-uniform parameter placeholder conventions of different SQL dialects.


    • text: string

      the raw query text with SQL parameter placeholders applied

    • Rest ...params: any[]

      the bound parameters supplied to the query

    Returns SqlQueryBuilder


  • Tag function for defining universal SQL queries by template literals.

    Template placeholder ${...} are treated as bound parameters supplied to the query and are substituted by the appropriate SQL parameter placeholder (e.g. $1, $2, etc. in Postgres, ? in mySQL, SQLite).

    Template placeholders can be annotated: Use ${...}{IDENT} or ${...}{LIT} to escape the values and insert them as SQL identifiers or literals in the query text. Note that annotated placeholders are not treated as bound parameters of the query.

    You can also use the SQL tag within a template placeholder to (recursively) insert another SQL query into the current one. This is useful if you want to conditionally insert or append subqueries.

    Example query:

    SQL`SELECT * FROM ${myTable}{IDENT} WHERE name = ${myName};`


    • parts: TemplateStringsArray

      the text parts between the placeholders

    • Rest ...values: any[]

      the evaluated expressions of all template placeholders.

    Returns SqlQueryBuilder

Generated using TypeDoc