This adapter uses sql.js to execute queries against the GeoPackage database

See

http://kripken.github.io/sql.js/documentation/|sqljs

Hierarchy

  • SqljsAdapter

Implements

Constructors

  • Parameters

    • Optional filePath: string | Buffer | Uint8Array

      string path to an existing file or a path to where a new file will be created or a url from which to download a GeoPackage or a Uint8Array containing the contents of the file, if undefined, an in memory database is created

    Returns SqljsAdapter

Properties

db: any
filePath: string | Buffer | Uint8Array
SQL: {
    Database: any;
}

Type declaration

  • Database: any
sqljsWasmLocateFile: ((filename: string) => string) = ...

Type declaration

    • (filename: string): string
    • Parameters

      • filename: string

      Returns string

Methods

  • Gets all results from the statement in an array

    Returns

    Parameters

    • sql: string

      statement to run

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

      bind parameters

    Returns Record<string, DBValue>[]

  • Runs an insert statement with the parameters provided

    Returns

    last inserted row id

    Parameters

    • statement: any

      statement to run

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

      bind parameters

    Returns number

  • Counts rows that match the query

    Returns

    count

    Parameters

    • tableName: string

      table name from which to count

    • Optional where: string

      where clause

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

      where args

    Returns number

  • Runs the specified delete statement and returns the number of deleted rows

    Returns

    deleted rows

    Parameters

    • sql: string

      statement to run

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

      bind parameters

    Returns number

  • Drops the table

    Returns

    indicates if the table was dropped

    Parameters

    • table: string

      table name

    Returns boolean

  • Returns an Iterable with results from the query

    Returns

    Parameters

    • sql: string

      statement to run

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

      bind parameters

    Returns IterableIterator<Record<string, DBValue>>

  • Runs the specified insert statement and returns the last inserted id or undefined if no insert happened

    Returns

    last inserted row id

    Parameters

    • sql: string

      statement to run

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

      bind parameters

    Returns number

  • Runs the statement specified, returning information about what changed

    See

    run

    Returns

    object containing a changes property indicating the number of rows changed and a lastInsertROWID indicating the last inserted row

    Parameters

    • sql: string

      statement to run

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

      bind parameters

    Returns {
        changes: number;
        lastInsertRowid: number;
    }

    • changes: number
    • lastInsertRowid: number
  • Parameters

    • locateFile: ((filename: string) => string)
        • (filename: string): string
        • Parameters

          • filename: string

          Returns string

    Returns void

Generated using TypeDoc