Represents a connection to the GeoPackage database

Hierarchy

  • GeoPackageConnection

Constructors

Properties

connectionSource: DBAdapter
registeredFunctions: string[]

Methods

  • Execute an aggregate function

    Returns

    value or null

    Parameters

    • func: string

      aggregate function

    • table: string

      able name

    • distinct: boolean

      distinct column flag

    • column: string

      column name

    • where: string

      where clause

    • args: any[] | Record<string, any>

      arguments

    Returns any

  • Executes the query and returns all results in an array

    Returns

    Parameters

    • sql: string

      sql to run

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

      substitution parameters

    Returns any[]

  • Check if the table column exists

    Returns

    true if column exists

    Parameters

    • tableName: string

      table name

    • columnName: string

      column name

    Returns boolean

  • Return the count of objects in the table

    Returns

    Parameters

    • table: string

      table name

    • Optional where: string

      where clause

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

      substitution parameters

    Returns number

  • Get a count of results

    Parameters

    • table: string
    • distinct: boolean = false
    • Optional column: string
    • Optional where: string
    • Optional whereArgs: [] | Record<string, any>

    Returns number

  • Delete from the table

    Returns

    number of rows deleted

    Parameters

    • tableName: string

      table name to delete from

    • Optional where: string

      where clause

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

      substitution parameters

    Returns number

  • Drops the table specified

    Returns

    results of table drop

    Parameters

    • tableName: string

      table to drop

    Returns boolean

  • Executes the query and returns an Iterable object of results

    Returns

    Parameters

    • sql: string

      sql to run

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

      substitution parameters

    Returns IterableIterator<any>

  • Perform a foreign key check

    Returns

    empty list if valid or violation errors, 4 column values for each violation. see SQLite PRAGMA foreign_key_check

    Returns any[]

  • Perform a foreign key check

    Returns

    empty list if valid or violation errors, 4 column values for each violation. see SQLite PRAGMA foreign_key_check

    Parameters

    • tableName: string

      table name

    Returns any[]

  • Gets the first result from the query

    Returns

    Parameters

    • sql: string

      sql query to run

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

      array of substitution parameters

    Returns Record<string, any>

  • Executes an insert statement and returns the last id inserted

    Returns

    last row id inserted

    Parameters

    • sql: string

      sql to insert

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

      substitution parameters

    Returns number

  • Checks if table exists in database

    Returns

    Parameters

    • tableName: string

    Returns boolean

  • Get the max result of the column

    Returns

    max or null

    Parameters

    • table: string

      table name

    • column: string

      column name

    • where: string

      where clause

    • args: any[]

      where arguments

    Returns number

  • Gets the maximum value from the column

    Returns

    Parameters

    • table: string

      table to query

    • column: string

      column to get the max value from

    • Optional where: string

      where clause

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

      substitution parameters

    Returns number

  • Get the min result of the column

    Returns

    min or null

    Parameters

    • table: string

      table name

    • column: string

      column name

    • where: string

      where clause

    • args: any[]

      where arguments

    Returns number

  • Gets the minimum value from the column

    Returns

    Parameters

    • table: string

      table to query

    • column: string

      column to get the min value from

    • Optional where: string

      where clause

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

      substitution parameters

    Returns number

  • Gets the first result from the query

    Returns

    Parameters

    • sql: string

      sql query to run

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

      array of substitution parameters

    Returns ResultSet

  • Query results and return array

    Parameters

    • sql: string
    • Optional args: String[]
    • Optional limit: number

    Returns any[][]

  • Queries for a single result

    Parameters

    • sql: string
    • Optional args: string[]
    • Optional column: number

    Returns any

  • Gets the first result from the query

    Returns

    Parameters

    • sql: string

      sql query to run

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

      array of substitution parameters

    Returns ResultSet

  • Registers the given function so that it can be used by SQL statements

    Returns

    the connection in use

    Parameters

    • name: string

      name of function to register

    • functionDefinition: Function

      function to register

    Returns DBAdapter

  • Run the given SQL and return the results.

    Returns

    object: { "changes": number, "lastInsertROWID": number }

    • changes: number of rows the statement changed
    • lastInsertROWID: ID of the last inserted row

    Parameters

    • sql: string

      sql to run

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

      array of substitution parameters

    Returns {
        changes: number;
        lastInsertRowid: number;
    }

    • changes: number
    • lastInsertRowid: number
  • Connects to a GeoPackage database

    Parameters

    • db: any

      database to connect to

    Returns void

  • Change the foreign keys state

    Returns

    previous foreign keys value

    Parameters

    • on: boolean

      true to turn on, false to turn off

    Returns boolean

  • Check if the table exists

    Returns

    true if exists

    Parameters

    • tableName: string

      table name

    Returns boolean

  • Check if a table or view exists with the name

    Returns

    true if exists

    Parameters

    • name: string

      table or view name

    Returns boolean

  • Check if the view exists

    Returns

    true if exists

    Parameters

    • viewName: string

      view name

    Returns boolean

Generated using TypeDoc