Inherits from NSObject
Declared in DTSQLiteDatabase.h

Overview

A wrapper for SQLite databases which offers threadsafe concurrency and support for cancelling long-running operations.

Instance Methods

cancelAllQueries

Cancels all currently queued queries

- (void)cancelAllQueries

Declared In

DTSQLiteDatabase.h

fetchRowsForQuery:error:

Fetches the result rows for a query.

- (NSArray *)fetchRowsForQuery:(NSString *)query error:(NSError **)error

Parameters

query

The SQL query to execute

error

If an error occurs this output parameter will contain it

Return Value

An array of NSDictionary instances

Discussion

You can call this from any queue/thread as long as it is the only one. For background operations you should call it exclusively via performBlock: or performBlockAndWait: for synchronization.

Declared In

DTSQLiteDatabase.h

initWithFileAtPath:

Opens the sqlite3 database file at the given path

- (id)initWithFileAtPath:(NSString *)path

Parameters

path

The file path to the database file

Declared In

DTSQLiteDatabase.h

performBlock:

The block to perform

- (void)performBlock:(void ( ^ ) ( ))block

Parameters

block

The block to perform

Declared In

DTSQLiteDatabase.h

performBlockAndWait:

The block to perform

- (void)performBlockAndWait:(void ( ^ ) ( ))block

Parameters

block

The block to perform

Declared In

DTSQLiteDatabase.h