Entity
    Preparing search index...

    Class StubPostgresDatabaseAdapter<TFields, TIDField>

    Type Parameters

    • TFields extends Record<string, any>
    • TIDField extends keyof TFields

    Hierarchy

    • BasePostgresEntityDatabaseAdapter<TFields, TIDField>
      • StubPostgresDatabaseAdapter
    Index

    Constructors

    Properties

    entityConfiguration: EntityConfiguration<TFields, TIDField>
    fieldTransformerMap: FieldTransformerMap

    Accessors

    • get paginationMaxPageSize(): number | undefined

      Get the maximum page size for pagination.

      Returns number | undefined

      maximum page size if configured, undefined otherwise

    Methods

    • Delete an object by ID.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • queryContext: EntityQueryContext

        query context with which to perform the deletion

      • idField: K

        the field in the object that is the ID

      • id: any

        the value of the ID field in the object

      Returns Promise<void>

    • Fetch many objects matching the conjunction of where clauses constructed from specified field equality operands.

      Type Parameters

      • N extends string | number | symbol

      Parameters

      • queryContext: EntityQueryContext

        query context with which to perform the fetch

      • fieldEqualityOperands: FieldEqualityCondition<TFields, N>[]

        list of field equality where clause operand specifications

      • querySelectionModifiers: PostgresQuerySelectionModifiers<TFields>

        limit, offset, orderBy, and orderByRaw for the query

      Returns Promise<readonly Readonly<TFields>[]>

      array of objects matching the query

    • Parameters

      • _queryInterface: any
      • tableName: string
      • tableFieldSingleValueEqualityOperands: TableFieldSingleValueEqualityCondition[]
      • tableFieldMultiValueEqualityOperands: TableFieldMultiValueEqualityCondition[]
      • querySelectionModifiers: TableQuerySelectionModifiers

      Returns Promise<object[]>

    • Fetch many objects matching the raw WHERE clause.

      Parameters

      • queryContext: EntityQueryContext

        query context with which to perform the fetch

      • rawWhereClause: string

        parameterized SQL WHERE clause with positional binding placeholders or named binding placeholders

      • bindings: object | any[]

        array of positional bindings or object of named bindings

      • querySelectionModifiers: PostgresQuerySelectionModifiersWithOrderByRaw<TFields>

        limit, offset, and orderBy for the query

      Returns Promise<readonly Readonly<TFields>[]>

      array of objects matching the query

    • Parameters

      • _queryInterface: any
      • _tableName: string
      • _rawWhereClause: string
      • _bindings: object | any[]
      • _querySelectionModifiers: TableQuerySelectionModifiers

      Returns Promise<object[]>

    • Fetch many objects matching the SQL fragment.

      Parameters

      • queryContext: EntityQueryContext

        query context with which to perform the fetch

      • sqlFragment: SQLFragment

        SQLFragment for the WHERE clause of the query

      • querySelectionModifiers: PostgresQuerySelectionModifiersWithOrderByFragment<TFields>

        limit, offset, and orderByFragment for the query

      Returns Promise<readonly Readonly<TFields>[]>

      array of objects matching the query

    • Parameters

      • _queryInterface: any
      • _tableName: string
      • _sqlFragment: SQLFragment
      • _querySelectionModifiers: TableQuerySelectionModifiersWithOrderByFragment

      Returns Promise<object[]>

    • Parameters

      • _queryInterface: any
      • tableName: string
      • tableColumns: readonly string[]
      • tableTuples: (readonly any[])[]

      Returns Promise<object[]>

    • Fetch one objects where key is equal to value, null if no matching object exists. Returned object is not guaranteed to be deterministic. Most concrete implementations will implement this with a "first" or "limit 1" query.

      Type Parameters

      Parameters

      • queryContext: EntityQueryContext

        query context with which to perform the fetch

      • key: TLoadKey

        load key being queried

      • value: TLoadValue

      Returns Promise<Readonly<TFields> | null>

      object that matches the query for the value

    • Parameters

      • queryInterface: any
      • tableName: string
      • tableColumns: readonly string[]
      • tableTuple: readonly any[]

      Returns Promise<object | null>

    • Transformer definitions for field types. Used to modify values as they are read from or written to the database. Override in concrete subclasses to change transformation behavior. If a field type is not present in the map, then fields of that type will not be transformed.

      Returns FieldTransformerMap

    • Insert an object.

      Parameters

      • queryContext: EntityQueryContext

        query context with which to perform the insert

      • object: Readonly<Partial<TFields>>

        the object to insert

      Returns Promise<Readonly<TFields>>

      the inserted object

    • Update an object.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • queryContext: EntityQueryContext

        query context with which to perform the update

      • idField: K

        the field in the object that is the ID

      • id: any

        the value of the ID field in the object

      • object: Readonly<Partial<TFields>>

        the object to update

      Returns Promise<Readonly<TFields>>

      the updated object

    • Parameters

      • _queryInterface: any
      • tableName: string
      • tableIdField: string
      • id: any
      • object: object

      Returns Promise<object[]>