Metadata Reference Data Access Object

Hierarchy

Constructors

Properties

Database connection to the sqlite file

geoPackage: GeoPackage

GeoPackage

gpkgTableName: string = MetadataReference.TABLE_NAME

Name of the table within the GeoPackage

idColumns: string[] = ...

ID Columns for this DAO

Methods

  • Builds a where clause from the field and value with an optional operation. If the value is empty, 'is null' is added to the query for the field

    Returns

    where clause

    Parameters

    • field: string

      field name

    • Optional value: DBValue

      optional value to filter on

    • Optional operation: string = '='

      optional operation

    Returns string

  • Count rows in the table optionally filtered by the parameters specified

    Returns

    count of objects

    Parameters

    • Optional fields: string | FieldValues

      Either a ColumnValues object or a string specifying a field name

    • Optional value: DBValue

      value to filter on if fields is a string

    Returns number

  • Count all matching objects

    Returns

    Parameters

    • join: string

      join clause

    • Optional where: string

      where clause

    • Optional whereArgs: DBValue[]

      array of where query values

    Returns number

  • Count rows in the table optionally filtered by the parameters specified

    Returns

    count of objects

    Parameters

    • where: string

      where string

    • whereArgs: DBValue[]

      arguments to filter on

    Returns number

  • Delete the object specified by the ids

    Returns

    number of objects deleted

    Parameters

    • idValues: any[]

      id values

    Returns number

  • Delete objects that match the query

    Returns

    number of objects deleted

    Parameters

    • where: string

      where clause

    • whereArgs: DBValue[]

      where arguments

    Returns number

  • Get the max of the column

    Returns

    Parameters

    • column: string

      column name

    • Optional where: string

      where clause

    • Optional whereArgs: DBValue[]

      where args

    Returns number

  • Get the min of the column

    Returns

    Parameters

    • column: string

      column name

    • Optional where: string

      where clause

    • Optional whereArgs: DBValue[]

      where args

    Returns number

  • Performs a raw query

    Parameters

    • sql: string
    • Optional params: [] | Record<string, any>

    Returns IterableIterator<any>

  • Queries for all matches and returns them in the callback. Be aware this pulls all results into memory

    Returns

    raw object array from the database

    Parameters

    • Optional where: string

      Optional where clause

    • Optional whereArgs: DBValue[]

      Optional where args array

    Returns Record<string, DBValue>[]

  • Query for all rows in the table that match

    Returns

    array of raw database objects

    Parameters

    • field: string

      field to match

    • value: DBValue

      value to match

    • Optional groupBy: string

      group by clause

    • Optional having: string

      having clause

    • Optional orderBy: string

      order by clause

    Returns Record<string, DBValue>[]

  • Queries for all items in the table with a page size and page number

    Returns

    raw object array from the database

    Parameters

    • pageSize: number

      size of the chunk to query for

    • page: number

      chunk number to query for

    Returns Record<string, DBValue>[]

  • Queries for all matches and returns them. Only queries for the specified column name Be aware this pulls all results into memory

    Returns

    raw object array from the database

    Parameters

    • columnName: string

      name of the column to query for

    • Optional fieldValues: FieldValues

      optional values to filter on

    Returns Record<string, DBValue>[]

  • Iterate all items in the table one at a time. If no parameters are passed, iterates the entire table. Returns an Iterable object

    Returns

    iterable of database objects

    Parameters

    • Optional field: string

      field to filter on

    • Optional value: DBValue

      value to filter on

    • Optional groupBy: string

      group by clause

    • Optional having: string

      having clause

    • Optional orderBy: string

      order by clause

    • Optional columns: string[]

      columns to retrieve

    Returns IterableIterator<Record<string, DBValue>>

  • Queries for all matches and returns them in the callback. Be aware this pulls all results into memory

    Returns

    raw object array from the database

    Parameters

    • fieldName: string

      name of the field to query for

    • value: string

      value of the like clause

    Returns Record<string, DBValue>[]

  • Iterate all matching objects

    Returns

    Parameters

    • join: string

      join clause

    • Optional where: string

      where clause

    • Optional whereArgs: DBValue[]

      array of where query values

    • Optional columns: string[]

      columns to query for

    Returns IterableIterator<Record<string, DBValue>>

  • Performs a raw query

    Parameters

    • sql: string
    • Optional params: [] | Record<string, any>

    Returns Record<string, DBValue>

  • Iterate all matching rows

    Returns

    Parameters

    • Optional where: string

      where clause

    • Optional whereArgs: DBValue[]

      array of where query values

    • Optional groupBy: string

      group by clause

    • Optional having: string

      having clause

    • Optional orderBy: string

      order by clause

    • Optional limit: number

      limit clause

    Returns IterableIterator<Record<string, DBValue>>

  • Update the object specified

    Returns

    number of objects updated

    Parameters

    Returns {
        changes: number;
        lastInsertRowid: number;
    }

    • changes: number
    • lastInsertRowid: number
  • Update all rows that match the query

    Returns

    number of objects updated

    Parameters

    • values: Record<string, DBValue>

      values to insert

    • where: string

      where clause

    • whereArgs: DBValue[]

      where arguments

    Returns {
        changes: number;
        lastInsertRowid: number;
    }

    • changes: number
    • lastInsertRowid: number

Generated using TypeDoc