Class PostgresEntityDatabaseAdapter<TFields>

Type Parameters

  • TFields

Hierarchy

  • default<TFields>
    • PostgresEntityDatabaseAdapter

Constructors

  • Type Parameters

    • TFields

    Parameters

    • entityConfiguration: default<TFields>

    Returns PostgresEntityDatabaseAdapter<TFields>

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: QuerySelectionModifiers<TFields>

      limit, offset, orderBy, and orderByRaw for the query

    Returns Promise<readonly Readonly<TFields>[]>

    array of objects matching the query

  • Parameters

    • queryInterface: Knex<any, 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: QuerySelectionModifiersWithOrderByRaw<TFields>

      limit, offset, and orderBy for the query

    Returns Promise<readonly Readonly<TFields>[]>

    array of objects matching the query

  • Parameters

    • queryInterface: Knex<any, any[]>
    • tableName: string
    • rawWhereClause: string
    • bindings: object | any[]
    • querySelectionModifiers: TableQuerySelectionModifiersWithOrderByRaw

    Returns Promise<object[]>

  • Fetch many objects where fieldName is one of fieldValues.

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • queryContext: EntityQueryContext

      query context with which to perform the fetch

    • field: K
    • fieldValues: readonly NonNullable<TFields[K]>[]

      fieldName field values being queried

    Returns Promise<ReadonlyMap<NonNullable<TFields[K]>, readonly Readonly<TFields>[]>>

    map from fieldValue to objects that match the query for that fieldValue

  • 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

Generated using TypeDoc