GPKGConnection

Objective-C

@interface GPKGConnection : NSObject

Swift

class GPKGConnection : NSObject

GeoPackage database connection

  • GeoPackage name

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *name;

    Swift

    var name: String! { get set }
  • GeoPackage filename

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *filename;

    Swift

    var filename: String! { get set }
  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithDatabaseFilename:(NSString *)filename;

    Swift

    init!(databaseFilename filename: String!)

    Parameters

    filename

    GeoPackage filename

    Return Value

    new connection

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithDatabaseFilename:(NSString *)filename
                                     andName:(NSString *)name;

    Swift

    init!(databaseFilename filename: String!, andName name: String!)

    Parameters

    filename

    GeoPackage filename

    name

    GeoPackage name

    Return Value

    new connection

  • Close the connection

    Declaration

    Objective-C

    - (void)close;

    Swift

    func close()
  • Raw query

    Declaration

    Objective-C

    - (GPKGResultSet *)rawQuery:(NSString *)statement;

    Swift

    func rawQuery(_ statement: String!) -> GPKGResultSet!

    Parameters

    statement

    query statement

    Return Value

    result set

  • Raw query

    Declaration

    Objective-C

    - (GPKGResultSet *)rawQuery:(NSString *)statement andArgs:(NSArray *)args;

    Swift

    func rawQuery(_ statement: String!, andArgs args: [Any]!) -> GPKGResultSet!

    Parameters

    statement

    query statement

    args

    query args

    Return Value

    result set

  • Query table columns where

    Declaration

    Objective-C

    - (GPKGResultSet *)queryWithTable:(NSString *)table
                           andColumns:(NSArray<NSString *> *)columns
                             andWhere:(NSString *)where
                         andWhereArgs:(NSArray *)whereArgs
                           andGroupBy:(NSString *)groupBy
                            andHaving:(NSString *)having
                           andOrderBy:(NSString *)orderBy;

    Swift

    func query(withTable table: String!, andColumns columns: [String]!, andWhere where: String!, andWhereArgs whereArgs: [Any]!, andGroupBy groupBy: String!, andHaving having: String!, andOrderBy orderBy: String!) -> GPKGResultSet!

    Parameters

    table

    table

    columns

    columns

    where

    where clause

    whereArgs

    where args

    groupBy

    group by clause

    having

    having clause

    orderBy

    order by clause

    Return Value

    result set

  • Query table columns where

    Declaration

    Objective-C

    - (GPKGResultSet *)queryWithDistinct:(BOOL)distinct
                                andTable:(NSString *)table
                              andColumns:(NSArray<NSString *> *)columns
                                andWhere:(NSString *)where
                            andWhereArgs:(NSArray *)whereArgs
                              andGroupBy:(NSString *)groupBy
                               andHaving:(NSString *)having
                              andOrderBy:(NSString *)orderBy;

    Swift

    func query(withDistinct distinct: Bool, andTable table: String!, andColumns columns: [String]!, andWhere where: String!, andWhereArgs whereArgs: [Any]!, andGroupBy groupBy: String!, andHaving having: String!, andOrderBy orderBy: String!) -> GPKGResultSet!

    Parameters

    distinct

    distinct flag

    table

    table

    columns

    columns

    where

    where clause

    whereArgs

    where args

    groupBy

    group by clause

    having

    having clause

    orderBy

    order by clause

    Return Value

    result set

  • Query table columns where

    Declaration

    Objective-C

    - (GPKGResultSet *)queryWithTable:(NSString *)table
                           andColumns:(NSArray<NSString *> *)columns
                             andWhere:(NSString *)where
                         andWhereArgs:(NSArray *)whereArgs
                           andGroupBy:(NSString *)groupBy
                            andHaving:(NSString *)having
                           andOrderBy:(NSString *)orderBy
                             andLimit:(NSString *)limit;

    Swift

    func query(withTable table: String!, andColumns columns: [String]!, andWhere where: String!, andWhereArgs whereArgs: [Any]!, andGroupBy groupBy: String!, andHaving having: String!, andOrderBy orderBy: String!, andLimit limit: String!) -> GPKGResultSet!

    Parameters

    table

    table

    columns

    columns

    where

    where clause

    whereArgs

    where args

    groupBy

    group by clause

    having

    having clause

    orderBy

    order by clause

    limit

    limit clause

    Return Value

    result set

  • Query table columns where

    Declaration

    Objective-C

    - (GPKGResultSet *)queryWithDistinct:(BOOL)distinct
                                andTable:(NSString *)table
                              andColumns:(NSArray<NSString *> *)columns
                                andWhere:(NSString *)where
                            andWhereArgs:(NSArray *)whereArgs
                              andGroupBy:(NSString *)groupBy
                               andHaving:(NSString *)having
                              andOrderBy:(NSString *)orderBy
                                andLimit:(NSString *)limit;

    Swift

    func query(withDistinct distinct: Bool, andTable table: String!, andColumns columns: [String]!, andWhere where: String!, andWhereArgs whereArgs: [Any]!, andGroupBy groupBy: String!, andHaving having: String!, andOrderBy orderBy: String!, andLimit limit: String!) -> GPKGResultSet!

    Parameters

    distinct

    distinct flag

    table

    table

    columns

    columns

    where

    where clause

    whereArgs

    where args

    groupBy

    group by clause

    having

    having clause

    orderBy

    order by clause

    limit

    limit clause

    Return Value

    result set

  • Build query SQL

    Declaration

    Objective-C

    - (NSString *)querySQLWithTable:(NSString *)table
                         andColumns:(NSArray<NSString *> *)columns
                           andWhere:(NSString *)where
                         andGroupBy:(NSString *)groupBy
                          andHaving:(NSString *)having
                         andOrderBy:(NSString *)orderBy;

    Swift

    func querySQL(withTable table: String!, andColumns columns: [String]!, andWhere where: String!, andGroupBy groupBy: String!, andHaving having: String!, andOrderBy orderBy: String!) -> String!

    Parameters

    table

    table

    columns

    columns

    where

    where clause

    groupBy

    group by clause

    having

    having clause

    orderBy

    order by clause

    Return Value

    SQL

  • Build query SQL

    Declaration

    Objective-C

    - (NSString *)querySQLWithDistinct:(BOOL)distinct
                              andTable:(NSString *)table
                            andColumns:(NSArray<NSString *> *)columns
                              andWhere:(NSString *)where
                            andGroupBy:(NSString *)groupBy
                             andHaving:(NSString *)having
                            andOrderBy:(NSString *)orderBy;

    Swift

    func querySQL(withDistinct distinct: Bool, andTable table: String!, andColumns columns: [String]!, andWhere where: String!, andGroupBy groupBy: String!, andHaving having: String!, andOrderBy orderBy: String!) -> String!

    Parameters

    distinct

    distinct flag

    table

    table

    columns

    columns

    where

    where clause

    groupBy

    group by clause

    having

    having clause

    orderBy

    order by clause

    Return Value

    SQL

  • Build query SQL

    Declaration

    Objective-C

    - (NSString *)querySQLWithTable:(NSString *)table
                         andColumns:(NSArray<NSString *> *)columns
                           andWhere:(NSString *)where
                         andGroupBy:(NSString *)groupBy
                          andHaving:(NSString *)having
                         andOrderBy:(NSString *)orderBy
                           andLimit:(NSString *)limit;

    Swift

    func querySQL(withTable table: String!, andColumns columns: [String]!, andWhere where: String!, andGroupBy groupBy: String!, andHaving having: String!, andOrderBy orderBy: String!, andLimit limit: String!) -> String!

    Parameters

    table

    table

    columns

    columns

    where

    where clause

    groupBy

    group by clause

    having

    having clause

    orderBy

    order by clause

    limit

    limit clause

    Return Value

    SQL

  • Build query SQL

    Declaration

    Objective-C

    - (NSString *)querySQLWithDistinct:(BOOL)distinct
                              andTable:(NSString *)table
                            andColumns:(NSArray<NSString *> *)columns
                              andWhere:(NSString *)where
                            andGroupBy:(NSString *)groupBy
                             andHaving:(NSString *)having
                            andOrderBy:(NSString *)orderBy
                              andLimit:(NSString *)limit;

    Swift

    func querySQL(withDistinct distinct: Bool, andTable table: String!, andColumns columns: [String]!, andWhere where: String!, andGroupBy groupBy: String!, andHaving having: String!, andOrderBy orderBy: String!, andLimit limit: String!) -> String!

    Parameters

    distinct

    distinct flag

    table

    table

    columns

    columns

    where

    where clause

    groupBy

    group by clause

    having

    having clause

    orderBy

    order by clause

    limit

    limit clause

    Return Value

    SQL

  • Count statement

    Declaration

    Objective-C

    - (int)count:(NSString *)statement;

    Swift

    func count(_ statement: String!) -> Int32

    Parameters

    statement

    count statement

    Return Value

    count

  • Count statement

    Declaration

    Objective-C

    - (int)count:(NSString *)statement andArgs:(NSArray *)args;

    Swift

    func count(_ statement: String!, andArgs args: [Any]!) -> Int32

    Parameters

    statement

    count statement

    args

    statement args

    Return Value

    count

  • Count with table

    Declaration

    Objective-C

    - (int)countWithTable:(NSString *)table;

    Swift

    func count(withTable table: String!) -> Int32

    Parameters

    table

    table name

    Return Value

    count

  • Count with table where

    Declaration

    Objective-C

    - (int)countWithTable:(NSString *)table andWhere:(NSString *)where;

    Swift

    func count(withTable table: String!, andWhere where: String!) -> Int32

    Parameters

    table

    table

    where

    where clause

    Return Value

    count

  • Count with table where

    Declaration

    Objective-C

    - (int)countWithTable:(NSString *)table
                 andWhere:(NSString *)where
             andWhereArgs:(NSArray *)whereArgs;

    Swift

    func count(withTable table: String!, andWhere where: String!, andWhereArgs whereArgs: [Any]!) -> Int32

    Parameters

    table

    table

    where

    where

    whereArgs

    where args

    Return Value

    count

  • Get a count of table results

    Declaration

    Objective-C

    - (int)countWithTable:(NSString *)table andColumn:(NSString *)column;

    Swift

    func count(withTable table: String!, andColumn column: String!) -> Int32

    Parameters

    table

    table name

    column

    column name

    Return Value

    count

  • Get a count of table results

    Declaration

    Objective-C

    - (int)countWithTable:(NSString *)table
              andDistinct:(BOOL)distinct
                andColumn:(NSString *)column;

    Swift

    func count(withTable table: String!, andDistinct distinct: Bool, andColumn column: String!) -> Int32

    Parameters

    table

    table name

    distinct

    distinct column flag

    column

    column name

    Return Value

    count

  • Get a count of table results

    Declaration

    Objective-C

    - (int)countWithTable:(NSString *)table
                andColumn:(NSString *)column
                 andWhere:(NSString *)where
             andWhereArgs:(NSArray *)whereArgs;

    Swift

    func count(withTable table: String!, andColumn column: String!, andWhere where: String!, andWhereArgs whereArgs: [Any]!) -> Int32

    Parameters

    table

    table name

    column

    column name

    where

    where clause

    whereArgs

    arguments

    Return Value

    count

  • Get a count of table results

    Declaration

    Objective-C

    - (int)countWithTable:(NSString *)table
              andDistinct:(BOOL)distinct
                andColumn:(NSString *)column
                 andWhere:(NSString *)where
             andWhereArgs:(NSArray *)whereArgs;

    Swift

    func count(withTable table: String!, andDistinct distinct: Bool, andColumn column: String!, andWhere where: String!, andWhereArgs whereArgs: [Any]!) -> Int32

    Parameters

    table

    table name

    distinct

    distinct column flag

    column

    column name

    where

    where clause

    whereArgs

    arguments

    Return Value

    count

  • Get the min result of the column

    Declaration

    Objective-C

    - (NSNumber *)minWithTable:(NSString *)table andColumn:(NSString *)column;

    Swift

    func min(withTable table: String!, andColumn column: String!) -> NSNumber!

    Parameters

    table

    table

    column

    column

    Return Value

    min or nil

  • Get the min result of the column

    Declaration

    Objective-C

    - (NSNumber *)minWithTable:(NSString *)table
                     andColumn:(NSString *)column
                      andWhere:(NSString *)where
                  andWhereArgs:(NSArray *)whereArgs;

    Swift

    func min(withTable table: String!, andColumn column: String!, andWhere where: String!, andWhereArgs whereArgs: [Any]!) -> NSNumber!

    Parameters

    table

    table

    column

    column

    where

    where

    whereArgs

    where args

    Return Value

    min or nil

  • Get the max result of the column

    Declaration

    Objective-C

    - (NSNumber *)maxWithTable:(NSString *)table andColumn:(NSString *)column;

    Swift

    func max(withTable table: String!, andColumn column: String!) -> NSNumber!

    Parameters

    table

    table

    column

    column

    Return Value

    max or nil

  • Get the max result of the column

    Declaration

    Objective-C

    - (NSNumber *)maxWithTable:(NSString *)table
                     andColumn:(NSString *)column
                      andWhere:(NSString *)where
                  andWhereArgs:(NSArray *)whereArgs;

    Swift

    func max(withTable table: String!, andColumn column: String!, andWhere where: String!, andWhereArgs whereArgs: [Any]!) -> NSNumber!

    Parameters

    table

    table

    column

    column

    where

    where

    whereArgs

    where args

    Return Value

    max or nil

  • Begin an exclusive transaction on the database

    Declaration

    Objective-C

    - (void)beginTransaction;

    Swift

    func beginTransaction()
  • Begin an exclusive transaction on the database, resetting other open connections upon commit

    Declaration

    Objective-C

    - (void)beginResettableTransaction;

    Swift

    func beginResettableTransaction()
  • Commit an active transaction

    Declaration

    Objective-C

    - (void)commitTransaction;

    Swift

    func commitTransaction()
  • Rollback an active transaction

    Declaration

    Objective-C

    - (void)rollbackTransaction;

    Swift

    func rollbackTransaction()
  • Determine if currently within a transaction

    Declaration

    Objective-C

    - (BOOL)inTransaction;

    Swift

    func inTransaction() -> Bool

    Return Value

    true if in transaction

  • If foreign keys is disabled and there are no foreign key violations, enables foreign key checks, else logs violations

    Declaration

    Objective-C

    - (BOOL)enableForeignKeys;

    Swift

    func enableForeignKeys() -> Bool

    Return Value

    true if enabled or already enabled, false if foreign key violations and not enabled

  • Query for the foreign keys value

    Declaration

    Objective-C

    - (BOOL)foreignKeys;

    Swift

    func foreignKeys() -> Bool

    Return Value

    true if enabled, false if disabled

  • Change the foreign keys state

    Declaration

    Objective-C

    - (BOOL)foreignKeysAsOn:(BOOL)on;

    Swift

    func foreignKeysAs(on: Bool) -> Bool

    Parameters

    on

    true to turn on, false to turn off

    Return Value

    previous foreign keys value

  • Perform a foreign key check

    Declaration

    Objective-C

    - (NSArray<GPKGRow *> *)foreignKeyCheck;

    Swift

    func foreignKeyCheck() -> [GPKGRow]!

    Return Value

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

  • Perform a foreign key check

    Declaration

    Objective-C

    - (NSArray<GPKGRow *> *)foreignKeyCheckOnTable:(NSString *)tableName;

    Swift

    func foreignKeyCheck(onTable tableName: String!) -> [GPKGRow]!

    Parameters

    tableName

    table name

    Return Value

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

  • Insert statement

    Declaration

    Objective-C

    - (long long)insert:(NSString *)statement;

    Swift

    func insert(_ statement: String!) -> Int64

    Parameters

    statement

    insert statement

    Return Value

    insertion id

  • Update statement

    Declaration

    Objective-C

    - (int)update:(NSString *)statement;

    Swift

    func update(_ statement: String!) -> Int32

    Parameters

    statement

    update statement

    Return Value

    updated rows

  • Update table where

    Declaration

    Objective-C

    - (int)updateWithTable:(NSString *)table
                 andValues:(GPKGContentValues *)values
                  andWhere:(NSString *)where;

    Swift

    func update(withTable table: String!, andValues values: GPKGContentValues!, andWhere where: String!) -> Int32

    Parameters

    table

    table

    values

    content values

    where

    where clause

    Return Value

    updated rows

  • Update table where

    Declaration

    Objective-C

    - (int)updateWithTable:(NSString *)table
                 andValues:(GPKGContentValues *)values
                  andWhere:(NSString *)where
              andWhereArgs:(NSArray *)whereArgs;

    Swift

    func update(withTable table: String!, andValues values: GPKGContentValues!, andWhere where: String!, andWhereArgs whereArgs: [Any]!) -> Int32

    Parameters

    table

    table

    values

    content values

    where

    where clause

    whereArgs

    where args

    Return Value

    updated rows

  • Insert into table

    Declaration

    Objective-C

    - (long long)insertWithTable:(NSString *)table
                       andValues:(GPKGContentValues *)values;

    Swift

    func insert(withTable table: String!, andValues values: GPKGContentValues!) -> Int64

    Parameters

    table

    table

    values

    content values

    Return Value

    insertion id

  • Delete statement

    Declaration

    Objective-C

    - (int)delete:(NSString *)statement;

    Swift

    func delete(_ statement: String!) -> Int32

    Parameters

    statement

    delete statement

    Return Value

    deleted rows

  • Delete from table where

    Declaration

    Objective-C

    - (int)deleteWithTable:(NSString *)table andWhere:(NSString *)where;

    Swift

    func delete(withTable table: String!, andWhere where: String!) -> Int32

    Parameters

    table

    table

    where

    where clause

    Return Value

    deleted rows

  • Delete from table where

    Declaration

    Objective-C

    - (int)deleteWithTable:(NSString *)table
                  andWhere:(NSString *)where
              andWhereArgs:(NSArray *)whereArgs;

    Swift

    func delete(withTable table: String!, andWhere where: String!, andWhereArgs whereArgs: [Any]!) -> Int32

    Parameters

    table

    table

    where

    where clause

    whereArgs

    where args

    Return Value

    deleted rows

  • Execute statement

    Declaration

    Objective-C

    - (void)exec:(NSString *)statement;

    Swift

    func exec(_ statement: String!)

    Parameters

    statement

    execute statement

  • Execute statement, resetting other open connections

    Declaration

    Objective-C

    - (void)execResettable:(NSString *)statement;

    Swift

    func execResettable(_ statement: String!)

    Parameters

    statement

    execute statement

  • Execute the statement once on all open connections, waiting for used connections

    Declaration

    Objective-C

    - (void)execAllConnectionStatement:(NSString *)statement;

    Swift

    func execAllConnectionStatement(_ statement: String!)

    Parameters

    statement

    SQL statement

  • Execute the statement on all open and new connections, waiting for used connections

    Declaration

    Objective-C

    - (void)execPersistentAllConnectionStatement:(NSString *)statement
                                          asName:(NSString *)name;

    Swift

    func execPersistentAllConnectionStatement(_ statement: String!, asName name: String!)

    Parameters

    statement

    SQL statement

    name

    unique statement key name

  • Remove a persistent statement

    Declaration

    Objective-C

    - (NSString *)removePersistentAllConnectionStatementWithName:(NSString *)name;

    Swift

    func removePersistentAllConnectionStatement(withName name: String!) -> String!

    Parameters

    name

    SQL statement key name

    Return Value

    removed statement or nil if not found

  • Check if a table exists

    Declaration

    Objective-C

    - (BOOL)tableExists:(NSString *)table;

    Swift

    func tableExists(_ table: String!) -> Bool

    Parameters

    table

    table name

    Return Value

    true if exists

  • Check if a view exists

    Declaration

    Objective-C

    - (BOOL)viewExists:(NSString *)view;

    Swift

    func viewExists(_ view: String!) -> Bool

    Parameters

    view

    view name

    Return Value

    true if exists

  • Check if a table or view exists with the name

    Declaration

    Objective-C

    - (BOOL)tableOrViewExists:(NSString *)name;

    Swift

    func tableOrViewExists(_ name: String!) -> Bool

    Parameters

    name

    table or view name

    Return Value

    true if exists

  • Check if the table column exists

    Declaration

    Objective-C

    - (BOOL)columnExistsWithTableName:(NSString *)tableName
                        andColumnName:(NSString *)columnName;

    Swift

    func columnExists(withTableName tableName: String!, andColumnName columnName: String!) -> Bool

    Parameters

    tableName

    table name

    columnName

    column name

    Return Value

    true if column exists

  • Add a new column to the table

    Declaration

    Objective-C

    - (void)addColumnWithTableName:(NSString *)tableName
                     andColumnName:(NSString *)columnName
                      andColumnDef:(NSString *)columndef;

    Swift

    func addColumn(withTableName tableName: String!, andColumnName columnName: String!, andColumnDef columndef: String!)

    Parameters

    tableName

    table name

    columnName

    column name

    columndef

    column definition

  • Query the SQL for a single result object in the first column

    Declaration

    Objective-C

    - (NSObject *)querySingleResultWithSql:(NSString *)sql andArgs:(NSArray *)args;

    Swift

    func querySingleResult(withSql sql: String!, andArgs args: [Any]!) -> NSObject!

    Parameters

    sql

    sql statement

    args

    sql arguments

    Return Value

    single result object

  • Query the SQL for a single result object in the first column with the expected data type

    Declaration

    Objective-C

    - (NSObject *)querySingleResultWithSql:(NSString *)sql
                                   andArgs:(NSArray *)args
                               andDataType:(enum GPKGDataType)dataType;

    Swift

    func querySingleResult(withSql sql: String!, andArgs args: [Any]!, andDataType dataType: GPKGDataType) -> NSObject!

    Parameters

    sql

    sql statement

    args

    sql arguments

    dataType

    GeoPackage data type

    Return Value

    single result object

  • Query the SQL for a single result object

    Declaration

    Objective-C

    - (NSObject *)querySingleResultWithSql:(NSString *)sql
                                   andArgs:(NSArray *)args
                                 andColumn:(int)column;

    Swift

    func querySingleResult(withSql sql: String!, andArgs args: [Any]!, andColumn column: Int32) -> NSObject!

    Parameters

    sql

    sql statement

    args

    arguments

    column

    column index

    Return Value

    result, null if no result

  • Query the SQL for a single result object with the expected data type

    Declaration

    Objective-C

    - (NSObject *)querySingleResultWithSql:(NSString *)sql
                                   andArgs:(NSArray *)args
                                 andColumn:(int)column
                               andDataType:(enum GPKGDataType)dataType;

    Swift

    func querySingleResult(withSql sql: String!, andArgs args: [Any]!, andColumn column: Int32, andDataType dataType: GPKGDataType) -> NSObject!

    Parameters

    sql

    sql statement

    args

    arguments

    column

    column index

    dataType

    GeoPackage data type

    Return Value

    result, null if no result

  • Query for values from the first column

    Declaration

    Objective-C

    - (NSArray<NSObject *> *)querySingleColumnResultsWithSql:(NSString *)sql
                                                     andArgs:(NSArray *)args;

    Swift

    func querySingleColumnResults(withSql sql: String!, andArgs args: [Any]!) -> [NSObject]!

    Parameters

    sql

    sql statement

    args

    sql arguments

    Return Value

    single column result strings

  • Query for values from the first column

    Declaration

    Objective-C

    - (NSArray<NSObject *> *)querySingleColumnResultsWithSql:(NSString *)sql
                                                     andArgs:(NSArray *)args
                                                 andDataType:
                                                     (enum GPKGDataType)dataType;

    Swift

    func querySingleColumnResults(withSql sql: String!, andArgs args: [Any]!, andDataType dataType: GPKGDataType) -> [NSObject]!

    Parameters

    sql

    sql statement

    args

    arguments

    dataType

    GeoPackage data type

    Return Value

    single column results

  • Query for values from a single column

    Declaration

    Objective-C

    - (NSArray<NSObject *> *)querySingleColumnResultsWithSql:(NSString *)sql
                                                     andArgs:(NSArray *)args
                                                   andColumn:(int)column;

    Swift

    func querySingleColumnResults(withSql sql: String!, andArgs args: [Any]!, andColumn column: Int32) -> [NSObject]!

    Parameters

    sql

    sql statement

    args

    arguments

    column

    column index

    Return Value

    single column results

  • Query for values from a single column

    Declaration

    Objective-C

    - (NSArray<NSObject *> *)querySingleColumnResultsWithSql:(NSString *)sql
                                                     andArgs:(NSArray *)args
                                                   andColumn:(int)column
                                                 andDataType:
                                                     (enum GPKGDataType)dataType;

    Swift

    func querySingleColumnResults(withSql sql: String!, andArgs args: [Any]!, andColumn column: Int32, andDataType dataType: GPKGDataType) -> [NSObject]!

    Parameters

    sql

    sql statement

    args

    arguments

    column

    column index

    dataType

    GeoPackage data type

    Return Value

    single column results

  • Query for values from a single column up to the limit

    Declaration

    Objective-C

    - (NSArray<NSObject *> *)querySingleColumnResultsWithSql:(NSString *)sql
                                                     andArgs:(NSArray *)args
                                                   andColumn:(int)column
                                                    andLimit:(NSNumber *)limit;

    Swift

    func querySingleColumnResults(withSql sql: String!, andArgs args: [Any]!, andColumn column: Int32, andLimit limit: NSNumber!) -> [NSObject]!

    Parameters

    sql

    sql statement

    args

    arguments

    column

    column index

    limit

    result row limit

    Return Value

    single column results

  • Query for values from a single column up to the limit

    Declaration

    Objective-C

    - (NSArray<NSObject *> *)querySingleColumnResultsWithSql:(NSString *)sql
                                                     andArgs:(NSArray *)args
                                                   andColumn:(int)column
                                                 andDataType:
                                                     (enum GPKGDataType)dataType
                                                    andLimit:(NSNumber *)limit;

    Swift

    func querySingleColumnResults(withSql sql: String!, andArgs args: [Any]!, andColumn column: Int32, andDataType dataType: GPKGDataType, andLimit limit: NSNumber!) -> [NSObject]!

    Parameters

    sql

    sql statement

    args

    arguments

    column

    column index

    dataType

    GeoPackage data type

    limit

    result row limit

    Return Value

    single column results

  • Query for values

    Declaration

    Objective-C

    - (NSArray<GPKGRow *> *)queryResultsWithSql:(NSString *)sql
                                        andArgs:(NSArray *)args;

    Swift

    func queryResults(withSql sql: String!, andArgs args: [Any]!) -> [GPKGRow]!

    Parameters

    sql

    sql statement

    args

    arguments

    Return Value

    results

  • Query for values

    Declaration

    Objective-C

    - (NSArray<GPKGRow *> *)queryResultsWithSql:(NSString *)sql
                                        andArgs:(NSArray *)args
                                   andDataTypes:(NSArray *)dataTypes;

    Swift

    func queryResults(withSql sql: String!, andArgs args: [Any]!, andDataTypes dataTypes: [Any]!) -> [GPKGRow]!

    Parameters

    sql

    sql statement

    args

    arguments

    dataTypes

    column data types

    Return Value

    results

  • Query for values in a single (first) row

    Declaration

    Objective-C

    - (GPKGRow *)querySingleRowResultsWithSql:(NSString *)sql
                                      andArgs:(NSArray *)args;

    Swift

    func querySingleRowResults(withSql sql: String!, andArgs args: [Any]!) -> GPKGRow!

    Parameters

    sql

    sql statement

    args

    arguments

    Return Value

    single row results

  • Query for values in a single (first) row

    Declaration

    Objective-C

    - (GPKGRow *)querySingleRowResultsWithSql:(NSString *)sql
                                      andArgs:(NSArray *)args
                                 andDataTypes:(NSArray *)dataTypes;

    Swift

    func querySingleRowResults(withSql sql: String!, andArgs args: [Any]!, andDataTypes dataTypes: [Any]!) -> GPKGRow!

    Parameters

    sql

    sql statement

    args

    arguments

    dataTypes

    column data types

    Return Value

    single row results

  • Query for values

    Declaration

    Objective-C

    - (NSArray<GPKGRow *> *)queryResultsWithSql:(NSString *)sql
                                        andArgs:(NSArray *)args
                                       andLimit:(NSNumber *)limit;

    Swift

    func queryResults(withSql sql: String!, andArgs args: [Any]!, andLimit limit: NSNumber!) -> [GPKGRow]!

    Parameters

    sql

    sql statement

    args

    arguments

    limit

    result row limit

    Return Value

    results

  • Query for values up to the limit

    Declaration

    Objective-C

    - (NSArray<GPKGRow *> *)queryResultsWithSql:(NSString *)sql
                                        andArgs:(NSArray *)args
                                   andDataTypes:(NSArray *)dataTypes
                                       andLimit:(NSNumber *)limit;

    Swift

    func queryResults(withSql sql: String!, andArgs args: [Any]!, andDataTypes dataTypes: [Any]!, andLimit limit: NSNumber!) -> [GPKGRow]!

    Parameters

    sql

    sql statement

    args

    arguments

    dataTypes

    column data types

    limit

    result row limit

    Return Value

    results

  • Set the GeoPackage application id

    Declaration

    Objective-C

    - (void)setApplicationId;

    Swift

    func setApplicationId()
  • Set the application id

    Declaration

    Objective-C

    - (void)setApplicationId:(NSString *)applicationId;

    Swift

    func setApplicationId(_ applicationId: String!)

    Parameters

    applicationId

    application id

  • Get the application id

    Declaration

    Objective-C

    - (NSString *)applicationId;

    Swift

    func applicationId() -> String!

    Return Value

    application id

  • Get the application id integer

    Declaration

    Objective-C

    - (NSNumber *)applicationIdNumber;

    Swift

    func applicationIdNumber() -> NSNumber!

    Return Value

    application id integer

  • Get the application id as a hex string prefixed with 0x

    Declaration

    Objective-C

    - (NSString *)applicationIdHex;

    Swift

    func applicationIdHex() -> String!

    Return Value

    application id hex string

  • Get the application id string value for the application id integer

    Declaration

    Objective-C

    + (NSString *)applicationIdOfNumber:(NSNumber *)applicationId;

    Swift

    class func applicationId(of applicationId: NSNumber!) -> String!

    Parameters

    applicationId

    application id integer

    Return Value

    application id

  • Set the GeoPackage user version

    Declaration

    Objective-C

    - (void)setUserVersion;

    Swift

    func setUserVersion()
  • Set the user version

    Declaration

    Objective-C

    - (void)setUserVersion:(int)userVersion;

    Swift

    func setUserVersion(_ userVersion: Int32)

    Parameters

    userVersion

    user version

  • Get the user version

    Declaration

    Objective-C

    - (NSNumber *)userVersion;

    Swift

    func userVersion() -> NSNumber!

    Return Value

    user version

  • Get the user version major

    Declaration

    Objective-C

    - (NSNumber *)userVersionMajor;

    Swift

    func userVersionMajor() -> NSNumber!

    Return Value

    user version major

  • Get the user version minor

    Declaration

    Objective-C

    - (NSNumber *)userVersionMinor;

    Swift

    func userVersionMinor() -> NSNumber!

    Return Value

    user version minor

  • Get the user version patch

    Declaration

    Objective-C

    - (NSNumber *)userVersionPatch;

    Swift

    func userVersionPatch() -> NSNumber!

    Return Value

    user version patch

  • Drop the table

    Declaration

    Objective-C

    - (void)dropTable:(NSString *)table;

    Swift

    func dropTable(_ table: String!)

    Parameters

    table

    table name

  • Add a custom function to be created on write connections

    Declaration

    Objective-C

    - (void)addWriteFunction:(void *)function
                    withName:(NSString *)name
                  andNumArgs:(int)numArgs;

    Swift

    func addWriteFunction(_ function: UnsafeMutableRawPointer!, withName name: String!, andNumArgs numArgs: Int32)

    Parameters

    function

    write connection function

    name

    function name

    numArgs

    number of function arguments

  • Add a custom function to be created on write connections

    Declaration

    Objective-C

    - (void)addWriteFunction:(GPKGConnectionFunction *)function;

    Swift

    func addWrite(_ function: GPKGConnectionFunction!)

    Parameters

    function

    write connection function

  • Add a custom function to be created on write connections

    Declaration

    Objective-C

    - (void)addWriteFunctions:(NSArray<GPKGConnectionFunction *> *)functions;

    Swift

    func addWrite(_ functions: [GPKGConnectionFunction]!)

    Parameters

    functions

    write connection functions