A Cocoa / Objective-C wrapper around SQLite

Related tags

Database fmdb
Overview

FMDB v2.7

CocoaPods Compatible Carthage Compatible

This is an Objective-C wrapper around SQLite.

The FMDB Mailing List:

https://groups.google.com/group/fmdb

Read the SQLite FAQ:

https://www.sqlite.org/faq.html

Since FMDB is built on top of SQLite, you're going to want to read this page top to bottom at least once. And while you're there, make sure to bookmark the SQLite Documentation page: https://www.sqlite.org/docs.html

Contributing

Do you have an awesome idea that deserves to be in FMDB? You might consider pinging ccgus first to make sure he hasn't already ruled it out for some reason. Otherwise pull requests are great, and make sure you stick to the local coding conventions. However, please be patient and if you haven't heard anything from ccgus for a week or more, you might want to send a note asking what's up.

Installing

CocoaPods

FMDB can be installed using CocoaPods.

If you haven't done so already, you might want to initialize the project, to have it produce a Podfile template for you:

$ pod init

Then, edit the Podfile, adding FMDB:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'MyApp' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!

    # Pods for MyApp2

    pod 'FMDB'
    # pod 'FMDB/FTS'   # FMDB with FTS
    # pod 'FMDB/standalone'   # FMDB with latest SQLite amalgamation source
    # pod 'FMDB/standalone/FTS'   # FMDB with latest SQLite amalgamation source and FTS
    # pod 'FMDB/SQLCipher'   # FMDB with SQLCipher
end

Then install the pods:

$ pod install

Then open the .xcworkspace rather than the .xcodeproj.

For more information on Cocoapods visit https://cocoapods.org.

If using FMDB with SQLCipher you must use the FMDB/SQLCipher subspec. The FMDB/SQLCipher subspec declares SQLCipher as a dependency, allowing FMDB to be compiled with the -DSQLITE_HAS_CODEC flag.

Carthage

Once you make sure you have the latest version of Carthage, you can open up a command line terminal, navigate to your project's main directory, and then do the following commands:

$ echo ' github "ccgus/fmdb" ' > ./Cartfile
$ carthage update

You can then configure your project as outlined in Carthage's Getting Started (i.e. for iOS, adding the framework to the "Link Binary with Libraries" in your target and adding the copy-frameworks script; in macOS, adding the framework to the list of "Embedded Binaries").

Swift Package Manager

Declare FMDB as a package dependency.

.package(
    name: "FMDB", 
    url: "https://github.com/ccgus/fmdb", 
    .upToNextMinor(from: "2.7.8")),

Use FMDB in target dependencies

.product(name: "FMDB", package: "FMDB")

FMDB Class Reference:

https://ccgus.github.io/fmdb/html/index.html

Automatic Reference Counting (ARC) or Manual Memory Management?

You can use either style in your Cocoa project. FMDB will figure out which you are using at compile time and do the right thing.

What's New in FMDB 2.7

FMDB 2.7 attempts to support a more natural interface. This represents a fairly significant change for Swift developers (audited for nullability; shifted to properties in external interfaces where possible rather than methods; etc.). For Objective-C developers, this should be a fairly seamless transition (unless you were using the ivars that were previously exposed in the public interface, which you shouldn't have been doing, anyway!).

Nullability and Swift Optionals

FMDB 2.7 is largely the same as prior versions, but has been audited for nullability. For Objective-C users, this simply means that if you perform a static analysis of your FMDB-based project, you may receive more meaningful warnings as you review your project, but there are likely to be few, if any, changes necessary in your code.

For Swift users, this nullability audit results in changes that are not entirely backward compatible with FMDB 2.6, but is a little more Swifty. Before FMDB was audited for nullability, Swift was forced to defensively assume that variables were optional, but the library now more accurately knows which properties and method parameters are optional, and which are not.

This means, though, that Swift code written for FMDB 2.7 may require changes. For example, consider the following Swift 3/Swift 4 code for FMDB 2.6:

queue.inTransaction { db, rollback in
    do {
        guard let db == db else {
            // handle error here
            return
        }

        try db.executeUpdate("INSERT INTO foo (bar) VALUES (?)", values: [1])
        try db.executeUpdate("INSERT INTO foo (bar) VALUES (?)", values: [2])
    } catch {
        rollback?.pointee = true
    }
}

Because FMDB 2.6 was not audited for nullability, Swift inferred that db and rollback were optionals. But, now, in FMDB 2.7, Swift now knows that, for example, neither db nor rollback above can be nil, so they are no longer optionals. Thus it becomes:

queue.inTransaction { db, rollback in
    do {
        try db.executeUpdate("INSERT INTO foo (bar) VALUES (?)", values: [1])
        try db.executeUpdate("INSERT INTO foo (bar) VALUES (?)", values: [2])
    } catch {
        rollback.pointee = true
    }
}

Custom Functions

In the past, when writing custom functions, you would have to generally include your own @autoreleasepool block to avoid problems when writing functions that scanned through a large table. Now, FMDB will automatically wrap it in an autorelease pool, so you don't have to.

Also, in the past, when retrieving the values passed to the function, you had to drop down to the SQLite C API and include your own sqlite3_value_XXX calls. There are now FMDatabase methods, valueInt, valueString, etc., so you can stay within Swift and/or Objective-C, without needing to call the C functions yourself. Likewise, when specifying the return values, you no longer need to call sqlite3_result_XXX C API, but rather you can use FMDatabase methods, resultInt, resultString, etc. There is a new enum for valueType called SqliteValueType, which can be used for checking the type of parameter passed to the custom function.

Thus, you can do something like (as of Swift 3):

db.makeFunctionNamed("RemoveDiacritics", arguments: 1) { context, argc, argv in
    guard db.valueType(argv[0]) == .text || db.valueType(argv[0]) == .null else {
        db.resultError("Expected string parameter", context: context)
        return
    }

    if let string = db.valueString(argv[0])?.folding(options: .diacriticInsensitive, locale: nil) {
        db.resultString(string, context: context)
    } else {
        db.resultNull(context: context)
    }
}

And you can then use that function in your SQL (in this case, matching both "Jose" and "José"):

SELECT * FROM employees WHERE RemoveDiacritics(first_name) LIKE 'jose'

Note, the method makeFunctionNamed:maximumArguments:withBlock: has been renamed to makeFunctionNamed:arguments:block:, to more accurately reflect the functional intent of the second parameter.

API Changes

In addition to the makeFunctionNamed noted above, there are a few other API changes. Specifically,

  • To become consistent with the rest of the API, the methods objectForColumnName and UTF8StringForColumnName have been renamed to objectForColumn and UTF8StringForColumn.

  • Note, the objectForColumn (and the associted subscript operator) now returns nil if an invalid column name/index is passed to it. It used to return NSNull.

  • To avoid confusion with FMDatabaseQueue method inTransaction, which performs transactions, the FMDatabase method to determine whether you are in a transaction or not, inTransaction, has been replaced with a read-only property, isInTransaction.

  • Several functions have been converted to properties, namely, databasePath, maxBusyRetryTimeInterval, shouldCacheStatements, sqliteHandle, hasOpenResultSets, lastInsertRowId, changes, goodConnection, columnCount, resultDictionary, applicationID, applicationIDString, userVersion, countOfCheckedInDatabases, countOfCheckedOutDatabases, and countOfOpenDatabases. For Objective-C users, this has little material impact, but for Swift users, it results in a slightly more natural interface. Note: For Objective-C developers, previously versions of FMDB exposed many ivars (but we hope you weren't using them directly, anyway!), but the implmentation details for these are no longer exposed.

URL Methods

In keeping with Apple's shift from paths to URLs, there are now NSURL renditions of the various init methods, previously only accepting paths.

Usage

There are three main classes in FMDB:

  1. FMDatabase - Represents a single SQLite database. Used for executing SQL statements.
  2. FMResultSet - Represents the results of executing a query on an FMDatabase.
  3. FMDatabaseQueue - If you're wanting to perform queries and updates on multiple threads, you'll want to use this class. It's described in the "Thread Safety" section below.

Database Creation

An FMDatabase is created with a path to a SQLite database file. This path can be one of these three:

  1. A file system path. The file does not have to exist on disk. If it does not exist, it is created for you.
  2. An empty string (@""). An empty database is created at a temporary location. This database is deleted when the FMDatabase connection is closed.
  3. NULL. An in-memory database is created. This database will be destroyed when the FMDatabase connection is closed.

(For more information on temporary and in-memory databases, read the sqlite documentation on the subject: https://www.sqlite.org/inmemorydb.html)

NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:@"tmp.db"];
FMDatabase *db = [FMDatabase databaseWithPath:path];

Opening

Before you can interact with the database, it must be opened. Opening fails if there are insufficient resources or permissions to open and/or create the database.

if (![db open]) {
    // [db release];   // uncomment this line in manual referencing code; in ARC, this is not necessary/permitted
    db = nil;
    return;
}

Executing Updates

Any sort of SQL statement which is not a SELECT statement qualifies as an update. This includes CREATE, UPDATE, INSERT, ALTER, COMMIT, BEGIN, DETACH, DELETE, DROP, END, EXPLAIN, VACUUM, and REPLACE statements (plus many more). Basically, if your SQL statement does not begin with SELECT, it is an update statement.

Executing updates returns a single value, a BOOL. A return value of YES means the update was successfully executed, and a return value of NO means that some error was encountered. You may invoke the -lastErrorMessage and -lastErrorCode methods to retrieve more information.

Executing Queries

A SELECT statement is a query and is executed via one of the -executeQuery... methods.

Executing queries returns an FMResultSet object if successful, and nil upon failure. You should use the -lastErrorMessage and -lastErrorCode methods to determine why a query failed.

In order to iterate through the results of your query, you use a while() loop. You also need to "step" from one record to the other. With FMDB, the easiest way to do that is like this:

FMResultSet *s = [db executeQuery:@"SELECT * FROM myTable"];
while ([s next]) {
    //retrieve values for each record
}

You must always invoke -[FMResultSet next] before attempting to access the values returned in a query, even if you're only expecting one:

FMResultSet *s = [db executeQuery:@"SELECT COUNT(*) FROM myTable"];
if ([s next]) {
    int totalCount = [s intForColumnIndex:0];
}
[s close];  // Call the -close method on the FMResultSet if you cannot confirm whether the result set is exhausted.

FMResultSet has many methods to retrieve data in an appropriate format:

  • intForColumn:
  • longForColumn:
  • longLongIntForColumn:
  • boolForColumn:
  • doubleForColumn:
  • stringForColumn:
  • dateForColumn:
  • dataForColumn:
  • dataNoCopyForColumn:
  • UTF8StringForColumn:
  • objectForColumn:

Each of these methods also has a {type}ForColumnIndex: variant that is used to retrieve the data based on the position of the column in the results, as opposed to the column's name.

Typically, there's no need to -close an FMResultSet yourself, since that happens when either the result set is exhausted. However, if you only pull out a single request or any other number of requests which don't exhaust the result set, you will need to call the -close method on the FMResultSet.

Closing

When you have finished executing queries and updates on the database, you should -close the FMDatabase connection so that SQLite will relinquish any resources it has acquired during the course of its operation.

[db close];

Transactions

FMDatabase can begin and commit a transaction by invoking one of the appropriate methods or executing a begin/end transaction statement.

Multiple Statements and Batch Stuff

You can use FMDatabase's executeStatements:withResultBlock: to do multiple statements in a string:

NSString *sql = @"create table bulktest1 (id integer primary key autoincrement, x text);"
                 "create table bulktest2 (id integer primary key autoincrement, y text);"
                 "create table bulktest3 (id integer primary key autoincrement, z text);"
                 "insert into bulktest1 (x) values ('XXX');"
                 "insert into bulktest2 (y) values ('YYY');"
                 "insert into bulktest3 (z) values ('ZZZ');";

success = [db executeStatements:sql];

sql = @"select count(*) as count from bulktest1;"
       "select count(*) as count from bulktest2;"
       "select count(*) as count from bulktest3;";

success = [self.db executeStatements:sql withResultBlock:^int(NSDictionary *dictionary) {
    NSInteger count = [dictionary[@"count"] integerValue];
    XCTAssertEqual(count, 1, @"expected one record for dictionary %@", dictionary);
    return 0;
}];

Data Sanitization

When providing a SQL statement to FMDB, you should not attempt to "sanitize" any values before insertion. Instead, you should use the standard SQLite binding syntax:

INSERT INTO myTable VALUES (?, ?, ?, ?)

The ? character is recognized by SQLite as a placeholder for a value to be inserted. The execution methods all accept a variable number of arguments (or a representation of those arguments, such as an NSArray, NSDictionary, or a va_list), which are properly escaped for you.

And, to use that SQL with the ? placeholders from Objective-C:

NSInteger identifier = 42;
NSString *name = @"Liam O'Flaherty (\"the famous Irish author\")";
NSDate *date = [NSDate date];
NSString *comment = nil;

BOOL success = [db executeUpdate:@"INSERT INTO authors (identifier, name, date, comment) VALUES (?, ?, ?, ?)", @(identifier), name, date, comment ?: [NSNull null]];
if (!success) {
    NSLog(@"error = %@", [db lastErrorMessage]);
}

Note: Fundamental data types, like the NSInteger variable identifier, should be as a NSNumber objects, achieved by using the @ syntax, shown above. Or you can use the [NSNumber numberWithInt:identifier] syntax, too.

Likewise, SQL NULL values should be inserted as [NSNull null]. For example, in the case of comment which might be nil (and is in this example), you can use the comment ?: [NSNull null] syntax, which will insert the string if comment is not nil, but will insert [NSNull null] if it is nil.

In Swift, you would use executeUpdate(values:), which not only is a concise Swift syntax, but also throws errors for proper error handling:

do {
    let identifier = 42
    let name = "Liam O'Flaherty (\"the famous Irish author\")"
    let date = Date()
    let comment: String? = nil

    try db.executeUpdate("INSERT INTO authors (identifier, name, date, comment) VALUES (?, ?, ?, ?)", values: [identifier, name, date, comment ?? NSNull()])
} catch {
    print("error = \(error)")
}

Note: In Swift, you don't have to wrap fundamental numeric types like you do in Objective-C. But if you are going to insert an optional string, you would probably use the comment ?? NSNull() syntax (i.e., if it is nil, use NSNull, otherwise use the string).

Alternatively, you may use named parameters syntax:

INSERT INTO authors (identifier, name, date, comment) VALUES (:identifier, :name, :date, :comment)

The parameters must start with a colon. SQLite itself supports other characters, but internally the dictionary keys are prefixed with a colon, do not include the colon in your dictionary keys.

NSDictionary *arguments = @{@"identifier": @(identifier), @"name": name, @"date": date, @"comment": comment ?: [NSNull null]};
BOOL success = [db executeUpdate:@"INSERT INTO authors (identifier, name, date, comment) VALUES (:identifier, :name, :date, :comment)" withParameterDictionary:arguments];
if (!success) {
    NSLog(@"error = %@", [db lastErrorMessage]);
}

The key point is that one should not use NSString method stringWithFormat to manually insert values into the SQL statement, itself. Nor should one Swift string interpolation to insert values into the SQL. Use ? placeholders for values to be inserted into the database (or used in WHERE clauses in SELECT statements).

Using FMDatabaseQueue and Thread Safety.

Using a single instance of FMDatabase from multiple threads at once is a bad idea. It has always been OK to make a FMDatabase object per thread. Just don't share a single instance across threads, and definitely not across multiple threads at the same time. Bad things will eventually happen and you'll eventually get something to crash, or maybe get an exception, or maybe meteorites will fall out of the sky and hit your Mac Pro. This would suck.

So don't instantiate a single FMDatabase object and use it across multiple threads.

Instead, use FMDatabaseQueue. Instantiate a single FMDatabaseQueue and use it across multiple threads. The FMDatabaseQueue object will synchronize and coordinate access across the multiple threads. Here's how to use it:

First, make your queue.

FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath];

Then use it like so:

[queue inDatabase:^(FMDatabase *db) {
    [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @1];
    [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @2];
    [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @3];

    FMResultSet *rs = [db executeQuery:@"select * from foo"];
    while ([rs next]) {
        …
    }
}];

An easy way to wrap things up in a transaction can be done like this:

[queue inTransaction:^(FMDatabase *db, BOOL *rollback) {
    [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @1];
    [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @2];
    [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @3];

    if (whoopsSomethingWrongHappened) {
        *rollback = YES;
        return;
    }

    // etc ...
}];

The Swift equivalent would be:

queue.inTransaction { db, rollback in
    do {
        try db.executeUpdate("INSERT INTO myTable VALUES (?)", values: [1])
        try db.executeUpdate("INSERT INTO myTable VALUES (?)", values: [2])
        try db.executeUpdate("INSERT INTO myTable VALUES (?)", values: [3])

        if whoopsSomethingWrongHappened {
            rollback.pointee = true
            return
        }

        // etc ...
    } catch {
        rollback.pointee = true
        print(error)
    }
}

(Note, as of Swift 3, use pointee. But in Swift 2.3, use memory rather than pointee.)

FMDatabaseQueue will run the blocks on a serialized queue (hence the name of the class). So if you call FMDatabaseQueue's methods from multiple threads at the same time, they will be executed in the order they are received. This way queries and updates won't step on each other's toes, and every one is happy.

Note: The calls to FMDatabaseQueue's methods are blocking. So even though you are passing along blocks, they will not be run on another thread.

Making custom sqlite functions, based on blocks.

You can do this! For an example, look for -makeFunctionNamed: in main.m

Swift

You can use FMDB in Swift projects too.

To do this, you must:

  1. Copy the relevant .m and .h files from the FMDB src folder into your project.

You can copy all of them (which is easiest), or only the ones you need. Likely you will need FMDatabase and FMResultSet at a minimum. FMDatabaseAdditions provides some very useful convenience methods, so you will likely want that, too. If you are doing multithreaded access to a database, FMDatabaseQueue is quite useful, too. If you choose to not copy all of the files from the src directory, though, you may want to update FMDB.h to only reference the files that you included in your project.

Note, if you're copying all of the files from the src folder into to your project (which is recommended), you may want to drag the individual files into your project, not the folder, itself, because if you drag the folder, you won't be prompted to add the bridging header (see next point).

  1. If prompted to create a "bridging header", you should do so. If not prompted and if you don't already have a bridging header, add one.

For more information on bridging headers, see Swift and Objective-C in the Same Project.

  1. In your bridging header, add a line that says:

    #import "FMDB.h"
  2. Use the variations of executeQuery and executeUpdate with the sql and values parameters with try pattern, as shown below. These renditions of executeQuery and executeUpdate both throw errors in true Swift fashion.

If you do the above, you can then write Swift code that uses FMDatabase. For example, as of Swift 3:

let fileURL = try! FileManager.default
    .url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
    .appendingPathComponent("test.sqlite")

let database = FMDatabase(url: fileURL)

guard database.open() else {
    print("Unable to open database")
    return
}

do {
    try database.executeUpdate("create table test(x text, y text, z text)", values: nil)
    try database.executeUpdate("insert into test (x, y, z) values (?, ?, ?)", values: ["a", "b", "c"])
    try database.executeUpdate("insert into test (x, y, z) values (?, ?, ?)", values: ["e", "f", "g"])

    let rs = try database.executeQuery("select x, y, z from test", values: nil)
    while rs.next() {
        if let x = rs.string(forColumn: "x"), let y = rs.string(forColumn: "y"), let z = rs.string(forColumn: "z") {
            print("x = \(x); y = \(y); z = \(z)")
        }
    }
} catch {
    print("failed: \(error.localizedDescription)")
}

database.close()

History

The history and changes are availbe on its GitHub page and are summarized in the "CHANGES_AND_TODO_LIST.txt" file.

Contributors

The contributors to FMDB are contained in the "Contributors.txt" file.

Additional projects using FMDB, which might be interesting to the discerning developer.

Quick notes on FMDB's coding style

Spaces, not tabs. Square brackets, not dot notation. Look at what FMDB already does with curly brackets and such, and stick to that style.

Reporting bugs

Reduce your bug down to the smallest amount of code possible. You want to make it super easy for the developers to see and reproduce your bug. If it helps, pretend that the person who can fix your bug is active on shipping 3 major products, works on a handful of open source projects, has a newborn baby, and is generally very very busy.

And we've even added a template function to main.m (FMDBReportABugFunction) in the FMDB distribution to help you out:

  • Open up fmdb project in Xcode.
  • Open up main.m and modify the FMDBReportABugFunction to reproduce your bug.
    • Setup your table(s) in the code.
    • Make your query or update(s).
    • Add some assertions which demonstrate the bug.

Then you can bring it up on the FMDB mailing list by showing your nice and compact FMDBReportABugFunction, or you can report the bug via the github FMDB bug reporter.

Optional:

Figure out where the bug is, fix it, and send a patch in or bring that up on the mailing list. Make sure all the other tests run after your modifications.

Support

The support channels for FMDB are the mailing list (see above), filing a bug here, or maybe on Stack Overflow. So that is to say, support is provided by the community and on a voluntary basis.

FMDB development is overseen by Gus Mueller of Flying Meat. If FMDB been helpful to you, consider purchasing an app from FM or telling all your friends about it.

License

The license for FMDB is contained in the "License.txt" file.

If you happen to come across either Gus Mueller or Rob Ryan in a bar, you might consider purchasing a drink of their choosing if FMDB has been useful to you.

(The drink is for them of course, shame on you for trying to keep it.)

Comments
  • Added a base class for all FMDatabase errors.

    Added a base class for all FMDatabase errors.

    Added an NSError child as a base class for all FMDatabase errors (both existing and upcoming ones). It should be easier for your users to handle them.

    Fixed error domain for SQL validation function.

    opened by dodikk 31
  • [feature] Compatibility with Carthage dependency manager

    [feature] Compatibility with Carthage dependency manager

    Carthage is intended to be the simplest way to add frameworks to your Cocoa application. Carthage builds your dependencies and provides you with binary frameworks, but you retain full control over your project structure and setup. Carthage does not automatically modify your project files or your build settings. https://github.com/Carthage/Carthage

    Scenario : As an iOS/Mac developer I want to use fmdb as a dynamic framework So that no linker conflicts take place between my shared logic and third-party frameworks depending on fmdb.

    Acceptance criteria :

    1. There should be a framework target for both iOS and OS X
    2. There should be two public schemes for each target mentioned in [1]
    3. There must be a semantic versioning compatible tag
    4. The frameworks must be successfully built by carthage
    echo ' github "ccgus/fmdb" ' > ./Cartfile
    carthage update
    

    5). It should be still possible to use fmdb as a static library (changes from #import "" to #import <> do not affect backward compatibility, I guess).

    opened by dodikk 27
  • Unable to use FMDB in a Swift framework

    Unable to use FMDB in a Swift framework

    Although it appears this problem was solved at one point in time, the proposed solution that defines sqlite3 as a module thus allowing the import of sqlite3.h in FMDB no longer seems to work after Xcode 6.0.1.

    http://programmingthomas.com/blog/2014/7/23/sqlite-in-swift-frameworks

    Error is:

    ...FMDB.framework/Headers/FMDatabase.h:2:9: error: include of non-modular header inside framework module 'FMDB.FMDatabase'
    #import "sqlite3.h"
    

    Note that this is not a situation where you can use a bridging header file as the desired artifact is a framework.

    opened by mharper 24
  • Added executeBulkSQL methods

    Added executeBulkSQL methods

    Also updated documentation for some of the old executeUpdate methods, as well updating main.m and FMDatabaseTests.m to include new methods.

    Gus, feel free to use this, or if you've done your own rendition, please disregard.

    opened by robertmryan 19
  • Data Sanitization of enumerable arguments in [FMDatabase executeQuery:withArgumentsInArray:]

    Data Sanitization of enumerable arguments in [FMDatabase executeQuery:withArgumentsInArray:]

    Hi,

    This commit provides data sanitization of NSArray, NSSet and NSOrderedSet arguments in [FMDatabase executeQuery:withArgumentsInArray:], and solves two problems:

    1. FMDB 2.1 requires users to provide as many question marks in the query as there are elements, and this is tedious when the enumerable object has a variable length.
    2. FMDB 2.1 surprises users who do not know well the internals of sqlite, and expect enumerables to be transparently expanded, as in famous ORMs such as ActiveRecord.

    For example:

    // Note the single question mark bound to an NSArray object.
    ids = @[@1, @2, @3];
    [db executeQuery:@"SELECT * FROM table WHERE id IN (?)" withArgumentsInArray:@[ids]]
    

    There are a few caveats, though. They are documented in the method implementation (see attached code).

    I hope you'll find this patch useful, and that we'll improve it together.

    opened by groue 19
  • Named parameter support

    Named parameter support

    I've implemented named parameter support in FMDB, as I need it for an upcoming project.

    I think I've followed the code style pretty well, you'll see one commit renames the arguments to match previous methods.

    opened by Drarok 19
  • Outdated readme

    Outdated readme

    Hello, i'm trying to use the data sanitization part of the readme for my swift project but it seems outdated, methods like executeUpdateWithFormat are not there, simple update method is not there either, what do you guys use for multiple types query?

    opened by tirrorex 18
  •  Crashed: fmdb.<FMDatabaseQueue: 0x28205def0> EXC_BREAKPOINT

    Crashed: fmdb. EXC_BREAKPOINT

    Some of our users encountered lots of crash in Fmdb queue. These devices iOS versions are iOS 12.4.0 and iOS 12.3.1. Device models are like iPhone 7, iPhone 7Plus and iPhone 6Plus. We found these users almost can't startup the app, cause the crash happened before the app launch. They try and try many times. But the crash still happened. I don't know if the crash is caused by Fmdb. And we can't reproduce this crash in our app. Please give me some clue about this crash. Thanks a lot.

    # Date: 2019-08-30T01:44:00Z
    # OS Version: 12.4.0 (16G77)
    # Device: iPhone 7
    # RAM Free: 4.5%
    # Disk Free: 7%
    
    #0. Crashed: fmdb.<FMDatabaseQueue: 0x280de8f90>
    0  libsystem_platform.dylib       0x1c520b04c _os_unfair_lock_unowned_abort + 36
    1  libsystem_platform.dylib       0x1c520c4f4 _os_unfair_lock_unlock_slow + 144
    2  libsqlite3.dylib               0x1c59faf18 sqlite3_snprintf + 3188
    3  libsqlite3.dylib               0x1c59fab18 sqlite3_snprintf + 2164
    4  libsqlite3.dylib               0x1c5a19c2c sqlite3_finalize + 11372
    5  libsqlite3.dylib               0x1c5a18b00 sqlite3_finalize + 6976
    6  libsqlite3.dylib               0x1c5a37ee4 sqlite3_step + 13664
    7  libsqlite3.dylib               0x1c5a34b40 sqlite3_step + 444
    8  MyAppName                     0x104aecff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
    9  MyAppName                     0x104aed3e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
    10 MyAppName                     0x104aeda1c -[FMDatabase beginTransaction] + 1346 (FMDatabase.m:1346)
    11 MyAppName                     0x104af0008 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 223 (FMDatabaseQueue.m:223)
    12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    13 libdispatch.dylib              0x1c4febc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
    14 MyAppName                     0x104aeff20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
    15 MyAppName                     0x1038624d0 -[SQDCDBManager queryTotalCount:] + 95 (SQDCDBManager.m:95)
    16 MyAppName                     0x103f45cec +[SQDataCenter saveLogs:] + 128 (SQDataCenter.m:128)
    17 MyAppName                     0x103f456d4 +[SQDataCenter trackEvent:label:eventList:parameters:] + 39 (SQDataCenter.m:39)
    18 MyAppName                     0x1035e09e0 -[AppDelegate application:didFinishLaunchingWithOptions:] + 41 (AppDelegate.m:41)
    19 UIKitCore                      0x1f204d0f0 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 412
    20 UIKitCore                      0x1f204e854 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3352
    21 UIKitCore                      0x1f2053fe0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1540
    22 UIKitCore                      0x1f19172a4 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 776
    23 UIKitCore                      0x1f191f83c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
    24 UIKitCore                      0x1f1916f28 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
    25 UIKitCore                      0x1f1917818 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1064
    26 UIKitCore                      0x1f1915b64 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 744
    27 UIKitCore                      0x1f191582c -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 428
    28 UIKitCore                      0x1f191a36c __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
    29 UIKitCore                      0x1f191b150 _performActionsWithDelayForTransitionContext + 112
    30 UIKitCore                      0x1f191a224 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 244
    31 UIKitCore                      0x1f191ef24 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 360
    32 UIKitCore                      0x1f20525e8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
    33 UIKitCore                      0x1f1c4ee04 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 360
    34 FrontBoardServices             0x1c7f7a9fc -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 440
    35 FrontBoardServices             0x1c7f8440c __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 256
    36 FrontBoardServices             0x1c7f83c14 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 64
    37 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    38 libdispatch.dylib              0x1c4fe25dc _dispatch_block_invoke_direct$VARIANT$mp + 224
    39 FrontBoardServices             0x1c7fb5040 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
    40 FrontBoardServices             0x1c7fb4cdc -[FBSSerialQueue _performNext] + 408
    41 FrontBoardServices             0x1c7fb5294 -[FBSSerialQueue _performNextFromRunLoopSource] + 52
    42 CoreFoundation                 0x1c5590728 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    43 CoreFoundation                 0x1c55906a8 __CFRunLoopDoSource0 + 88
    44 CoreFoundation                 0x1c558ff90 __CFRunLoopDoSources0 + 176
    45 CoreFoundation                 0x1c558aecc __CFRunLoopRun + 1004
    46 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    47 GraphicsServices               0x1c778b79c GSEventRunModal + 104
    48 UIKitCore                      0x1f2055c38 UIApplicationMain + 212
    49 MyAppName                     0x1047b2580 main + 18 (main.m:18)
    50 libdyld.dylib                  0x1c504e8e0 start + 4
    
    --
    
    #0. Crashed: fmdb.<FMDatabaseQueue: 0x280de8f90>
    0  libsystem_platform.dylib       0x1c520b04c _os_unfair_lock_unowned_abort + 36
    1  libsystem_platform.dylib       0x1c520c4f4 _os_unfair_lock_unlock_slow + 144
    2  libsqlite3.dylib               0x1c59faf18 sqlite3_snprintf + 3188
    3  libsqlite3.dylib               0x1c59fab18 sqlite3_snprintf + 2164
    4  libsqlite3.dylib               0x1c5a19c2c sqlite3_finalize + 11372
    5  libsqlite3.dylib               0x1c5a18b00 sqlite3_finalize + 6976
    6  libsqlite3.dylib               0x1c5a37ee4 sqlite3_step + 13664
    7  libsqlite3.dylib               0x1c5a34b40 sqlite3_step + 444
    8  MyAppName                     0x104aecff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
    9  MyAppName                     0x104aed3e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
    10 MyAppName                     0x104aeda1c -[FMDatabase beginTransaction] + 1346 (FMDatabase.m:1346)
    11 MyAppName                     0x104af0008 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 223 (FMDatabaseQueue.m:223)
    12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    13 libdispatch.dylib              0x1c4febc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
    14 MyAppName                     0x104aeff20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
    15 MyAppName                     0x1038624d0 -[SQDCDBManager queryTotalCount:] + 95 (SQDCDBManager.m:95)
    16 MyAppName                     0x103f45cec +[SQDataCenter saveLogs:] + 128 (SQDataCenter.m:128)
    17 MyAppName                     0x103f456d4 +[SQDataCenter trackEvent:label:eventList:parameters:] + 39 (SQDataCenter.m:39)
    18 MyAppName                     0x1035e09e0 -[AppDelegate application:didFinishLaunchingWithOptions:] + 41 (AppDelegate.m:41)
    19 UIKitCore                      0x1f204d0f0 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 412
    20 UIKitCore                      0x1f204e854 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3352
    21 UIKitCore                      0x1f2053fe0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1540
    22 UIKitCore                      0x1f19172a4 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 776
    23 UIKitCore                      0x1f191f83c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
    24 UIKitCore                      0x1f1916f28 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
    25 UIKitCore                      0x1f1917818 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1064
    26 UIKitCore                      0x1f1915b64 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 744
    27 UIKitCore                      0x1f191582c -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 428
    28 UIKitCore                      0x1f191a36c __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
    29 UIKitCore                      0x1f191b150 _performActionsWithDelayForTransitionContext + 112
    30 UIKitCore                      0x1f191a224 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 244
    31 UIKitCore                      0x1f191ef24 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 360
    32 UIKitCore                      0x1f20525e8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
    33 UIKitCore                      0x1f1c4ee04 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 360
    34 FrontBoardServices             0x1c7f7a9fc -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 440
    35 FrontBoardServices             0x1c7f8440c __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 256
    36 FrontBoardServices             0x1c7f83c14 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 64
    37 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    38 libdispatch.dylib              0x1c4fe25dc _dispatch_block_invoke_direct$VARIANT$mp + 224
    39 FrontBoardServices             0x1c7fb5040 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
    40 FrontBoardServices             0x1c7fb4cdc -[FBSSerialQueue _performNext] + 408
    41 FrontBoardServices             0x1c7fb5294 -[FBSSerialQueue _performNextFromRunLoopSource] + 52
    42 CoreFoundation                 0x1c5590728 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    43 CoreFoundation                 0x1c55906a8 __CFRunLoopDoSource0 + 88
    44 CoreFoundation                 0x1c558ff90 __CFRunLoopDoSources0 + 176
    45 CoreFoundation                 0x1c558aecc __CFRunLoopRun + 1004
    46 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    47 GraphicsServices               0x1c778b79c GSEventRunModal + 104
    48 UIKitCore                      0x1f2055c38 UIApplicationMain + 212
    49 MyAppName                     0x1047b2580 main + 18 (main.m:18)
    50 libdyld.dylib                  0x1c504e8e0 start + 4
    
    #1. com.autonavi.servicesQueue
    0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
    1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
    2  libdispatch.dylib              0x1c4ff4884 _dispatch_mach_send_and_wait_for_reply + 500
    3  libdispatch.dylib              0x1c4ff4d14 dispatch_mach_send_with_result_and_wait_for_reply$VARIANT$mp + 52
    4  libxpc.dylib                   0x1c525491c xpc_connection_send_message_with_reply_sync + 204
    5  Security                       0x1c626789c securityd_message_with_reply_sync + 96
    6  Security                       0x1c6267e1c securityd_send_sync_and_do + 80
    7  Security                       0x1c62bdec0 __SecItemCopyMatching_block_invoke_2 + 236
    8  Security                       0x1c62bcda0 __SecItemAuthDoQuery_block_invoke + 312
    9  Security                       0x1c62bb70c SecItemAuthDo + 124
    10 Security                       0x1c62bc0a0 SecItemAuthDoQuery + 504
    11 Security                       0x1c62bddc8 __SecItemCopyMatching_block_invoke + 104
    12 Security                       0x1c62b9d30 SecOSStatusWith + 48
    13 Security                       0x1c62bc488 SecItemCopyMatching + 332
    14 MyAppName                     0x104e4766c -[AMapFoundationKeychainManager setObject:forKey:] + 529968
    15 MyAppName                     0x104e24708 -[AMapADIUManager ADIU] + 386764
    16 MyAppName                     0x104e30ed8 __20-[AMapServices init]_block_invoke + 437916
    17 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    18 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    19 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
    20 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
    21 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
    22 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
    23 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #2. com.apple.Pasteboard.notification-queue
    0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
    2  Foundation                     0x1c5fc6908 -[__NSOperationInternal _waitUntilFinished:] + 772
    3  Foundation                     0x1c5f813f4 -[__NSObserver _doit:] + 240
    4  CoreFoundation                 0x1c556fa28 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
    5  CoreFoundation                 0x1c556f9f4 ___CFXRegistrationPost_block_invoke + 64
    6  CoreFoundation                 0x1c556eee8 _CFXRegistrationPost + 392
    7  CoreFoundation                 0x1c556eb94 ___CFXNotificationPost_block_invoke + 96
    8  CoreFoundation                 0x1c54e8474 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1496
    9  CoreFoundation                 0x1c556e644 _CFXNotificationPost + 696
    10 Foundation                     0x1c5f576f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
    11 Pasteboard                     0x1da119c4c __67+[PBServerConnection beginListeningToPasteboardChangeNotifications]_block_invoke_2
    12 libsystem_notify.dylib         0x1c52032f4 notify_register_mach_port + 7436
    13 libdispatch.dylib              0x1c4feb7f4 _dispatch_block_async_invoke2 + 104
    14 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    15 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
    16 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
    17 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
    18 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
    19 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #3. com.tencent.bugly.operationQueue (QOS: UTILITY)
    0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
    2  Foundation                     0x1c5fc6908 -[__NSOperationInternal _waitUntilFinished:] + 772
    3  Foundation                     0x1c5f94ecc -[NSOperationQueue waitUntilAllOperationsAreFinished] + 248
    4  MyAppName                     0x10549a268 -[BLYDataManager fetchObjFromFileWithFileName:persistenceType:] + 17264
    5  MyAppName                     0x10549a0a8 -[BLYDataManager fetchObjWithKey:persistenceType:] + 16816
    6  MyAppName                     0x1054861dc -[BLYAnalyticsLogic userInfoPackage] + 4591864
    7  MyAppName                     0x105485a40 -[BLYAnalyticsLogic jceModel] + 4589916
    8  MyAppName                     0x10548d810 -[BLYCommonUploadLogic main] + 4622124
    9  Foundation                     0x1c5f6f7c8 -[__NSOperationInternal _start:] + 740
    10 Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
    11 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    13 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
    14 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
    15 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
    16 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
    17 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
    18 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #4. com.apple.uikit.eventfetch-thread
    0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
    1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
    2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
    3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
    4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    5  Foundation                     0x1c5f58eac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
    6  Foundation                     0x1c5f58d3c -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
    7  UIKitCore                      0x1f213b754 -[UIEventFetcher threadMain] + 136
    8  Foundation                     0x1c6085674 __NSThread__start__ + 984
    9  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    10 libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    11 libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #5. Thread
    0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190
    
    #6. JavaScriptCore bmalloc scavenger
    0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
    2  libc++.1.dylib                 0x1c4771090 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
    3  JavaScriptCore                 0x1cc81ede0 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 108
    4  JavaScriptCore                 0x1cc822dd4 bmalloc::Scavenger::threadRunLoop() + 176
    5  JavaScriptCore                 0x1cc82254c bmalloc::Scavenger::Scavenger(std::__1::lock_guard<bmalloc::Mutex>&) + 10
    6  JavaScriptCore                 0x1cc823f8c std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer(std::__1::__thread_struct*) + 38
    7  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    8  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    9  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #7. WebThread
    0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
    2  JavaScriptCore                 0x1cc7e588c WTF::ThreadCondition::timedWait(WTF::Mutex&, WTF::WallTime) + 80
    3  JavaScriptCore                 0x1cc7cc514 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2004
    4  JavaScriptCore                 0x1cc7bc7b4 WTF::LockAlgorithm<unsigned char, (unsigned char)1, (unsigned char)2, WTF::EmptyLockHooks<unsigned char> >::lockSlow(WTF::Atomic<unsigned char>&) + 232
    5  WebCore                        0x1ce27b66c _WebThreadLock() + 264
    6  WebCore                        0x1ce27e1f0 WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 44
    7  CoreFoundation                 0x1c558fd08 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
    8  CoreFoundation                 0x1c558aa30 __CFRunLoopDoObservers + 412
    9  CoreFoundation                 0x1c558b190 __CFRunLoopRun + 1712
    10 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    11 WebCore                        0x1ce27dfc4 RunWebThread(void*) + 600
    12 libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    13 libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    14 libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #8. com.apple.NSURLConnectionLoader
    0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
    1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
    2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
    3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
    4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    5  CFNetwork                      0x1c5ba474c -[__CoreSchedulingSetRunnable runForever] + 216
    6  Foundation                     0x1c6085674 __NSThread__start__ + 984
    7  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    8  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    9  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #9. com.tencent.bugly.persistenceQueue (QOS: UTILITY)
    0  CoreFoundation                 0x1c55c92b8 __CFStrConvertBytesToUnicode + 16
    1  CoreFoundation                 0x1c55b00a8 _CFStringCheckAndGetCharacters + 216
    2  CoreFoundation                 0x1c54f0cdc -[__NSCFString getCharacters:range:] + 48
    3  Foundation                     0x1c5f7eb34 -[NSString(NSPathUtilities) lastPathComponent] + 168
    4  Foundation                     0x1c606a848 _NSCreateTemporaryFile_Protected + 776
    5  Foundation                     0x1c606ad3c _NSWriteDataToFileWithExtendedAttributes + 272
    6  MyAppName                     0x10549aa6c __77-[BLYDataManager persistData:ofType:enableNotifications:withCompletionBlock:]_block_invoke + 19316
    7  Foundation                     0x1c6063ec8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
    8  Foundation                     0x1c5f702e0 -[NSBlockOperation main] + 72
    9  Foundation                     0x1c5f6f7c8 -[__NSOperationInternal _start:] + 740
    10 Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
    11 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    13 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
    14 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
    15 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
    16 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
    17 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
    18 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #10. Thread
    0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190
    
    #11. MainRunloopMonitor
    0  libsystem_kernel.dylib         0x1c5190148 semaphore_timedwait_trap + 8
    1  libdispatch.dylib              0x1c4fdf888 _dispatch_sema4_timedwait$VARIANT$mp + 64
    2  libdispatch.dylib              0x1c4fe01dc _dispatch_semaphore_wait_slow + 72
    3  MyAppName                     0x1054a10cc -[BLYMainRunloopMonitorManager monitorThreadRun] + 45524
    4  Foundation                     0x1c6085674 __NSThread__start__ + 984
    5  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    6  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    7  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #12. com.twitter.crashlytics.ios.MachExceptionServer
    0  MyAppName                     0x1054f1d98 CLSProcessRecordAllThreads + 376480
    1  MyAppName                     0x1054f2180 CLSProcessRecordAllThreads + 377480
    2  MyAppName                     0x1054e19f8 CLSHandler + 310016
    3  MyAppName                     0x1054dcdd8 CLSMachExceptionServer + 290528
    4  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    5  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    6  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #13. com.apple.root.default-qos
    0  libsystem_kernel.dylib         0x1c519c8f4 kevent + 8
    1  libsystem_info.dylib           0x1c514d190 _mdns_search_ex + 1972
    2  libsystem_info.dylib           0x1c514c8f0 _mdns_search + 128
    3  libsystem_info.dylib           0x1c514be94 mdns_addrinfo + 896
    4  libsystem_info.dylib           0x1c5151be0 search_addrinfo + 264
    5  libsystem_info.dylib           0x1c5155be8 si_addrinfo + 1652
    6  libsystem_info.dylib           0x1c5149598 _getaddrinfo_internal + 196
    7  libsystem_info.dylib           0x1c51494c8 getaddrinfo + 52
    8  MyAppName                     0x104cf4e28 +[WXOMTAGCDAsyncSocket lookupHost:port:error:] + 4408299048
    9  MyAppName                     0x104ce9220 __76-[WXOMTAGCDAsyncSocket connectToHost:onPort:viaInterface:withTimeout:error:]_block_invoke_2 + 4408250912
    10 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    11 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    12 libdispatch.dylib              0x1c4fe1c80 _dispatch_queue_override_invoke + 684
    13 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
    14 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
    15 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
    16 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #14. NSOperationQueue 0x2803dfd60 (QOS: UNSPECIFIED)
    0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
    1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
    2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
    3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
    4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    5  Foundation                     0x1c5f58eac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
    6  MyAppName                     0x104e3d4a0 -[AMapMacFinderPingOperation start] + 488548
    7  Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
    8  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    9  libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    10 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
    11 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
    12 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
    13 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
    14 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
    15 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #15. com.analysys.serialQueue
    0  libsystem_kernel.dylib         0x1c519b9d4 __ulock_wait + 8
    1  libdispatch.dylib              0x1c4fdfa5c _dispatch_ulock_wait + 56
    2  libdispatch.dylib              0x1c4fdfb94 _dispatch_thread_event_wait_slow$VARIANT$mp + 48
    3  libdispatch.dylib              0x1c4febec0 __DISPATCH_WAIT_FOR_QUEUE__ + 328
    4  libdispatch.dylib              0x1c4febad8 _dispatch_sync_f_slow + 140
    5  MyAppName                     0x105c31844 +[NSThread(ANSHelper) AnsRunOnMainThread:] + 1285324
    6  MyAppName                     0x105c41564 +[ANSFileManager saveUserDefaultWithKey:value:] + 1350124
    7  MyAppName                     0x105c2d280 -[AnalysysSDK isAppKeyChanged:] + 1267464
    8  MyAppName                     0x105c291a8 __31-[AnalysysSDK startWithConfig:]_block_invoke_2 + 1250864
    9  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    10 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    11 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
    12 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
    13 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
    14 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
    15 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #16. com.apple.CFSocket.private
    0  libsystem_kernel.dylib         0x1c519b328 __select + 8
    1  CoreFoundation                 0x1c5598e04 __CFSocketManager + 620
    2  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    3  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    4  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #17. Thread
    0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190
    
    #18. Thread
    0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190
    
    
    

    Another stack trace:

    
    # Date: 2019-08-30T02:36:00Z
    # OS Version: 12.4.0 (16G77)
    # Device: iPhone 7
    # RAM Free: 5.1%
    # Disk Free: 7%
    
    #0. Crashed: fmdb.<FMDatabaseQueue: 0x28205def0>
    0  libsystem_platform.dylib       0x1c520b04c _os_unfair_lock_unowned_abort + 36
    1  libsystem_platform.dylib       0x1c520c4f4 _os_unfair_lock_unlock_slow + 144
    2  libsqlite3.dylib               0x1c59faf18 sqlite3_snprintf + 3188
    3  libsqlite3.dylib               0x1c59fab18 sqlite3_snprintf + 2164
    4  libsqlite3.dylib               0x1c5a19c2c sqlite3_finalize + 11372
    5  libsqlite3.dylib               0x1c5a18b00 sqlite3_finalize + 6976
    6  libsqlite3.dylib               0x1c5a37ee4 sqlite3_step + 13664
    7  libsqlite3.dylib               0x1c5a34b40 sqlite3_step + 444
    8  MyAppName                     0x106230ff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
    9  MyAppName                     0x1062313e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
    10 MyAppName                     0x106231a1c -[FMDatabase beginTransaction] + 1346 (FMDatabase.m:1346)
    11 MyAppName                     0x106234008 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 223 (FMDatabaseQueue.m:223)
    12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    13 libdispatch.dylib              0x1c4febc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
    14 MyAppName                     0x106233f20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
    15 MyAppName                     0x104fa64d0 -[SQDCDBManager queryTotalCount:] + 95 (SQDCDBManager.m:95)
    16 MyAppName                     0x105689cec +[SQDataCenter saveLogs:] + 128 (SQDataCenter.m:128)
    17 MyAppName                     0x1056896d4 +[SQDataCenter trackEvent:label:eventList:parameters:] + 39 (SQDataCenter.m:39)
    18 MyAppName                     0x105ca7cb8 -[UIViewController(SQDataCenter) sqdc_viewDidAppear:] + 42 (UIViewController+SQDataCenter.m:42)
    19 MyAppName                     0x107377bfc ans_swizzledMethod_3_bool + 1294468
    20 UIKitCore                      0x1f1ab1a20 -[UIViewController _setViewAppearState:isAnimating:] + 808
    21 UIKitCore                      0x1f1ab4354 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 44
    22 UIKitCore                      0x1f1ab29c0 -[UIViewController _executeAfterAppearanceBlock] + 88
    23 UIKitCore                      0x1f20611b8 _runAfterCACommitDeferredBlocks + 564
    24 UIKitCore                      0x1f204fbfc _cleanUpAfterCAFlushAndRunDeferredBlocks + 352
    25 UIKitCore                      0x1f206e868 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 136
    26 CoreFoundation                 0x1c5590578 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
    27 CoreFoundation                 0x1c558fe7c __CFRunLoopDoBlocks + 272
    28 CoreFoundation                 0x1c558aee0 __CFRunLoopRun + 1024
    29 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    30 GraphicsServices               0x1c778b79c GSEventRunModal + 104
    31 UIKitCore                      0x1f2055c38 UIApplicationMain + 212
    32 MyAppName                     0x105ef6580 main + 18 (main.m:18)
    33 libdyld.dylib                  0x1c504e8e0 start + 4
    
    --
    
    #0. Crashed: fmdb.<FMDatabaseQueue: 0x28205def0>
    0  libsystem_platform.dylib       0x1c520b04c _os_unfair_lock_unowned_abort + 36
    1  libsystem_platform.dylib       0x1c520c4f4 _os_unfair_lock_unlock_slow + 144
    2  libsqlite3.dylib               0x1c59faf18 sqlite3_snprintf + 3188
    3  libsqlite3.dylib               0x1c59fab18 sqlite3_snprintf + 2164
    4  libsqlite3.dylib               0x1c5a19c2c sqlite3_finalize + 11372
    5  libsqlite3.dylib               0x1c5a18b00 sqlite3_finalize + 6976
    6  libsqlite3.dylib               0x1c5a37ee4 sqlite3_step + 13664
    7  libsqlite3.dylib               0x1c5a34b40 sqlite3_step + 444
    8  MyAppName                     0x106230ff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
    9  MyAppName                     0x1062313e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
    10 MyAppName                     0x106231a1c -[FMDatabase beginTransaction] + 1346 (FMDatabase.m:1346)
    11 MyAppName                     0x106234008 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 223 (FMDatabaseQueue.m:223)
    12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    13 libdispatch.dylib              0x1c4febc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
    14 MyAppName                     0x106233f20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
    15 MyAppName                     0x104fa64d0 -[SQDCDBManager queryTotalCount:] + 95 (SQDCDBManager.m:95)
    16 MyAppName                     0x105689cec +[SQDataCenter saveLogs:] + 128 (SQDataCenter.m:128)
    17 MyAppName                     0x1056896d4 +[SQDataCenter trackEvent:label:eventList:parameters:] + 39 (SQDataCenter.m:39)
    18 MyAppName                     0x105ca7cb8 -[UIViewController(SQDataCenter) sqdc_viewDidAppear:] + 42 (UIViewController+SQDataCenter.m:42)
    19 MyAppName                     0x107377bfc ans_swizzledMethod_3_bool + 1294468
    20 UIKitCore                      0x1f1ab1a20 -[UIViewController _setViewAppearState:isAnimating:] + 808
    21 UIKitCore                      0x1f1ab4354 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 44
    22 UIKitCore                      0x1f1ab29c0 -[UIViewController _executeAfterAppearanceBlock] + 88
    23 UIKitCore                      0x1f20611b8 _runAfterCACommitDeferredBlocks + 564
    24 UIKitCore                      0x1f204fbfc _cleanUpAfterCAFlushAndRunDeferredBlocks + 352
    25 UIKitCore                      0x1f206e868 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 136
    26 CoreFoundation                 0x1c5590578 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
    27 CoreFoundation                 0x1c558fe7c __CFRunLoopDoBlocks + 272
    28 CoreFoundation                 0x1c558aee0 __CFRunLoopRun + 1024
    29 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    30 GraphicsServices               0x1c778b79c GSEventRunModal + 104
    31 UIKitCore                      0x1f2055c38 UIApplicationMain + 212
    32 MyAppName                     0x105ef6580 main + 18 (main.m:18)
    33 libdyld.dylib                  0x1c504e8e0 start + 4
    
    #1. com.apple.Pasteboard.notification-queue
    0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
    2  Foundation                     0x1c5fc6908 -[__NSOperationInternal _waitUntilFinished:] + 772
    3  Foundation                     0x1c5f813f4 -[__NSObserver _doit:] + 240
    4  CoreFoundation                 0x1c556fa28 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
    5  CoreFoundation                 0x1c556f9f4 ___CFXRegistrationPost_block_invoke + 64
    6  CoreFoundation                 0x1c556eee8 _CFXRegistrationPost + 392
    7  CoreFoundation                 0x1c556eb94 ___CFXNotificationPost_block_invoke + 96
    8  CoreFoundation                 0x1c54e8474 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1496
    9  CoreFoundation                 0x1c556e644 _CFXNotificationPost + 696
    10 Foundation                     0x1c5f576f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
    11 Pasteboard                     0x1da119c4c __67+[PBServerConnection beginListeningToPasteboardChangeNotifications]_block_invoke_2
    12 libsystem_notify.dylib         0x1c52032f4 notify_register_mach_port + 7436
    13 libdispatch.dylib              0x1c4feb7f4 _dispatch_block_async_invoke2 + 104
    14 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    15 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
    16 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
    17 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
    18 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
    19 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #2. Thread
    0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190
    
    #3. com.tencent.bugly.persistenceQueue (QOS: UTILITY)
    0  libsystem_kernel.dylib         0x1c519c408 fsync + 8
    1  Foundation                     0x1c606aeac _NSWriteDataToFileWithExtendedAttributes + 640
    2  MyAppName                     0x106bdea6c __77-[BLYDataManager persistData:ofType:enableNotifications:withCompletionBlock:]_block_invoke + 19316
    3  Foundation                     0x1c6063ec8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
    4  Foundation                     0x1c5f702e0 -[NSBlockOperation main] + 72
    5  Foundation                     0x1c5f6f7c8 -[__NSOperationInternal _start:] + 740
    6  Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
    7  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    8  libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    9  libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
    10 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
    11 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
    12 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
    13 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
    14 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #4. com.apple.uikit.eventfetch-thread
    0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
    1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
    2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
    3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
    4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    5  Foundation                     0x1c5f58eac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
    6  Foundation                     0x1c5f58d3c -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
    7  UIKitCore                      0x1f213b754 -[UIEventFetcher threadMain] + 136
    8  Foundation                     0x1c6085674 __NSThread__start__ + 984
    9  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    10 libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    11 libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #5. com.apple.CoreLocation.0x1088542d0
    0  libsystem_kernel.dylib         0x1c5190148 semaphore_timedwait_trap + 8
    1  libdispatch.dylib              0x1c4fdf888 _dispatch_sema4_timedwait$VARIANT$mp + 64
    2  libdispatch.dylib              0x1c4fe01dc _dispatch_semaphore_wait_slow + 72
    3  CoreLocation                   0x1cc3a26cc CLClientInvalidate + 896
    4  CoreLocation                   0x1cc3a77d4 CLClientStopVehicleHeadingUpdates + 1668
    5  CoreLocation                   0x1cc400e4c CLGetControlPlaneStatusReport + 40940
    6  CoreLocation                   0x1cc400d78 CLGetControlPlaneStatusReport + 40728
    7  CoreLocation                   0x1cc3fbca4 CLGetControlPlaneStatusReport + 20036
    8  CoreLocation                   0x1cc3fbb5c CLGetControlPlaneStatusReport + 19708
    9  CoreLocation                   0x1cc3fde98 CLGetControlPlaneStatusReport + 28728
    10 libxpc.dylib                   0x1c5255afc _xpc_connection_call_event_handler + 68
    11 libxpc.dylib                   0x1c5255e60 _xpc_connection_mach_event + 856
    12 libdispatch.dylib              0x1c503d894 _dispatch_client_callout4 + 16
    13 libdispatch.dylib              0x1c4ff55c0 _dispatch_mach_msg_invoke$VARIANT$mp + 340
    14 libdispatch.dylib              0x1c4fe61f0 _dispatch_lane_serial_drain$VARIANT$mp + 284
    15 libdispatch.dylib              0x1c4ff61cc _dispatch_mach_invoke$VARIANT$mp + 476
    16 libdispatch.dylib              0x1c4fe61f0 _dispatch_lane_serial_drain$VARIANT$mp + 284
    17 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
    18 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
    19 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
    20 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #6. io.answers.EventQueue (QOS: BACKGROUND)
    0  libsystem_kernel.dylib         0x1c519ca5c lstat + 8
    1  Foundation                     0x1c602ccb4 _NSFileExistsAtPath + 192
    2  Foundation                     0x1c5f7d320 -[NSFileManager fileExistsAtPath:isDirectory:] + 128
    3  Foundation                     0x1c5f7d624 -[NSURL(NSURL) initFileURLWithPath:] + 276
    4  Foundation                     0x1c5f7d4fc +[NSURL(NSURL) fileURLWithPath:] + 48
    5  MyAppName                     0x106c4c1d4 -[ANSAnswersController generateNewLogPath] + 467676
    6  MyAppName                     0x106c4ba88 __56-[ANSAnswersController initWithBetaToken:rootDirectory:]_block_invoke + 465808
    7  Foundation                     0x1c6063ec8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
    8  Foundation                     0x1c5f702e0 -[NSBlockOperation main] + 72
    9  Foundation                     0x1c5f6f7c8 -[__NSOperationInternal _start:] + 740
    10 Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
    11 libdispatch.dylib              0x1c4feb7f4 _dispatch_block_async_invoke2 + 104
    12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    13 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
    14 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
    15 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
    16 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
    17 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
    18 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #7. com.apple.root.default-qos
    0  libsystem_kernel.dylib         0x1c519c8f4 kevent + 8
    1  libsystem_info.dylib           0x1c514d190 _mdns_search_ex + 1972
    2  libsystem_info.dylib           0x1c514c8f0 _mdns_search + 128
    3  libsystem_info.dylib           0x1c514be94 mdns_addrinfo + 896
    4  libsystem_info.dylib           0x1c5151be0 search_addrinfo + 264
    5  libsystem_info.dylib           0x1c5155be8 si_addrinfo + 1652
    6  libsystem_info.dylib           0x1c5149598 _getaddrinfo_internal + 196
    7  libsystem_info.dylib           0x1c51494c8 getaddrinfo + 52
    8  MyAppName                     0x106438e28 +[WXOMTAGCDAsyncSocket lookupHost:port:error:] + 4404186664
    9  MyAppName                     0x10642d220 __76-[WXOMTAGCDAsyncSocket connectToHost:onPort:viaInterface:withTimeout:error:]_block_invoke_2 + 4404138528
    10 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    11 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    12 libdispatch.dylib              0x1c4fe1c80 _dispatch_queue_override_invoke + 684
    13 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
    14 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
    15 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
    16 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #8. com.apple.NSURLConnectionLoader
    0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
    1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
    2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
    3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
    4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    5  CFNetwork                      0x1c5ba474c -[__CoreSchedulingSetRunnable runForever] + 216
    6  Foundation                     0x1c6085674 __NSThread__start__ + 984
    7  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    8  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    9  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #9. JavaScriptCore bmalloc scavenger
    0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
    2  libc++.1.dylib                 0x1c4771090 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
    3  JavaScriptCore                 0x1cc81ede0 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 108
    4  JavaScriptCore                 0x1cc822dd4 bmalloc::Scavenger::threadRunLoop() + 176
    5  JavaScriptCore                 0x1cc82254c bmalloc::Scavenger::Scavenger(std::__1::lock_guard<bmalloc::Mutex>&) + 10
    6  JavaScriptCore                 0x1cc823f8c std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer(std::__1::__thread_struct*) + 38
    7  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    8  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    9  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #10. WebThread
    0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
    2  JavaScriptCore                 0x1cc7e588c WTF::ThreadCondition::timedWait(WTF::Mutex&, WTF::WallTime) + 80
    3  JavaScriptCore                 0x1cc7cc514 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2004
    4  JavaScriptCore                 0x1cc7bc7b4 WTF::LockAlgorithm<unsigned char, (unsigned char)1, (unsigned char)2, WTF::EmptyLockHooks<unsigned char> >::lockSlow(WTF::Atomic<unsigned char>&) + 232
    5  WebCore                        0x1ce27b66c _WebThreadLock() + 264
    6  WebCore                        0x1ce27e1f0 WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 44
    7  CoreFoundation                 0x1c558fd08 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
    8  CoreFoundation                 0x1c558aa30 __CFRunLoopDoObservers + 412
    9  CoreFoundation                 0x1c558b190 __CFRunLoopRun + 1712
    10 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    11 WebCore                        0x1ce27dfc4 RunWebThread(void*) + 600
    12 libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    13 libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    14 libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #11. MainRunloopMonitor
    0  libsystem_kernel.dylib         0x1c5190148 semaphore_timedwait_trap + 8
    1  libdispatch.dylib              0x1c4fdf888 _dispatch_sema4_timedwait$VARIANT$mp + 64
    2  libdispatch.dylib              0x1c4fe01dc _dispatch_semaphore_wait_slow + 72
    3  MyAppName                     0x106be50cc -[BLYMainRunloopMonitorManager monitorThreadRun] + 45524
    4  Foundation                     0x1c6085674 __NSThread__start__ + 984
    5  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    6  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    7  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #12. com.twitter.crashlytics.ios.MachExceptionServer
    0  MyAppName                     0x106c35d98 CLSProcessRecordAllThreads + 376480
    1  MyAppName                     0x106c36180 CLSProcessRecordAllThreads + 377480
    2  MyAppName                     0x106c259f8 CLSHandler + 310016
    3  MyAppName                     0x106c20dd8 CLSMachExceptionServer + 290528
    4  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    5  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    6  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    #13. Thread
    0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190
    
    #14. NSOperationQueue 0x282e3e780 (QOS: UNSPECIFIED)
    0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
    1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
    2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
    3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
    4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
    5  Foundation                     0x1c5f58eac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
    6  MyAppName                     0x1065814a0 -[AMapMacFinderPingOperation start] + 488548
    7  Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
    8  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    9  libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    10 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
    11 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
    12 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
    13 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
    14 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
    15 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #15. com.analysys.serialQueue
    0  libsystem_kernel.dylib         0x1c519b9d4 __ulock_wait + 8
    1  libdispatch.dylib              0x1c4fdfa5c _dispatch_ulock_wait + 56
    2  libdispatch.dylib              0x1c4fdfb94 _dispatch_thread_event_wait_slow$VARIANT$mp + 48
    3  libdispatch.dylib              0x1c4febec0 __DISPATCH_WAIT_FOR_QUEUE__ + 328
    4  libdispatch.dylib              0x1c4febad8 _dispatch_sync_f_slow + 140
    5  MyAppName                     0x107375844 +[NSThread(ANSHelper) AnsRunOnMainThread:] + 1285324
    6  MyAppName                     0x107385564 +[ANSFileManager saveUserDefaultWithKey:value:] + 1350124
    7  MyAppName                     0x107371280 -[AnalysysSDK isAppKeyChanged:] + 1267464
    8  MyAppName                     0x10736d1a8 __31-[AnalysysSDK startWithConfig:]_block_invoke_2 + 1250864
    9  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
    10 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
    11 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
    12 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
    13 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
    14 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
    15 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #16. Thread
    0  libsystem_kernel.dylib         0x1c519bb74 __workq_kernreturn + 8
    1  libsystem_pthread.dylib        0x1c521e138 _pthread_wqthread + 340
    2  libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4
    
    #17. com.apple.CFSocket.private
    0  libsystem_kernel.dylib         0x1c519b328 __select + 8
    1  CoreFoundation                 0x1c5598e04 __CFSocketManager + 620
    2  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
    3  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
    4  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
    
    
    
    opened by Daemonson 17
  • dateForColumn since1970

    dateForColumn since1970

    Hi,

    I deal with CoreDate sqlite where real data is from [NSDate dateWithTimeIntervalSinceReferenceDate:] intead of [NSDate dateWithTimeIntervalSince1970:]. Don't know if it's common, but this is how it work with CoreData Data columns.

    opened by krzyzanowskim 17
  • Improving thread safety of FMResultSet

    Improving thread safety of FMResultSet

    Hello! We've been noticing some crashes (although relatively few) in production when closing an FMResultSet. The crash happens when FMResultSet contacts its parentDB to remove itself from the set of open results sets. We believe the crashing is occurring because it's not safe to mutate a container from multiple threads. That said, I believe it's safe to close and otherwise use sqlite result sets from the same db connection on different threads (lets assume each result set gets its own thread) when sqlite is in serialized mode, which is the default.

    What do you all think would be the best course of action here? Would you all agree that this is something that should be fixed, and if so, do you think it'd make sense to add an internal queue/lock to synchronize the mutable containers internal to FMDatabase?

    Thanks for your consideration!

    opened by benasher44 15
  • Modified to support using framework

    Modified to support using framework

    To use FMDB in framework, one should eliminate all non-modular headers. The main culprit here is #import <sqlite3.h>. The thing is, FMDB uses SQLite types and constants in these headers, so they had to be removed.

    1. Removed #import <sqlite3.h> from all of the headers.
    2. Moved sqlite3 and sqlite3_stmt declarations in FMDatabase.h into FMDatabasePrivate.h. FMDB source that needs these will now `#import "FMDatabasePrivate.h" and will have access to them.
    3. Removed #if SQLITE_VERSION_NUMBER >= xxx logic from the headers.
    4. lastInsertRowId now returns long long int, not sqlite3_int64.
    5. sqliteHandle now returns void * not sqlite3 *.
    6. The savepoint and release savepoint and rollback now always compile regardless of SQLite version (but you'll get SQLite errors if you try those commands with earlier SQLite versions).
    7. makeFunctionNamed has changed the block parameter type.
    8. The FMDatabaseAdditions routines for applicationID, much like the savepoint routines, will be compiled regardless of SQLite version.
    9. Some random usage of deferencing ivars from another class have been replaced with accessor methods.

    Note, with all of these changes, in order to conform to modular headers, this is not entirely backward compatible. They'll have to make changes if

    • If they referenced the _db variable themselves (which they shouldn't be doing anyway; this never should have been in the public interface to start with);
    • If they referenced _statement variable of FMStatement (which is even less likely); or
    • If they used makeFunctionNamed, the signature of the block has changed (now uses void instead of SQLite types).
    opened by robertmryan 15
  • Flutter support

    Flutter support

    Hi and thanks for your project. FMDB is actively used in the flutter world through the sqflite plugin https://pub.dev/packages/sqflite, a cross platform SQLite solution where I am the main maintainer. Disclaimer: I'm a bad iOS/MacOS developer. I found FMDB easy to use and perfect for the situation (and the same code - objective C - is used for iOS and MacOS)

    I'm using FMDB 2.7.5 although there seems to have been some updates since but I cannot figure out whether it has been published and available from Pods.

    Due to the nature of flutter, I had to export an internal API:

    // Import hidden method
    @interface FMDatabase ()
    - (void)resultSetDidClose:(FMResultSet *)resultSet;
    @end
    

    This allowed me to keep a cursor open (without getting a warning) and reuse it later (always in a inDatabase block though). I'm not sure that's correct but it works.

    Do you think that it would be possible to export this method ? As a more general questions, is FMDB still maintain as it is now (I have seen some threads regarding re-building in swift so I'm not sure where it stands and how long the existing flutter solution will work).

    Thanks again for your work.

    opened by alextekartik 0
  • Unable to install the latest podversion of FMDB and SQLCipher

    Unable to install the latest podversion of FMDB and SQLCipher

    I'm currently trying to install the latest version of FNB & SQL cipher on an M1 Mac; my terminal is using Rosetta to install pods. When I try to update the FMDB and SQL using pod install it still shows the old version number - FMDB 2.7.5 -> (unused) (latest version 4.0.2). I tried clearing the pods and reinstalling but it still didn’t work ? Any suggestions?

    Screen Shot 2022-08-15 at 5 15 14 PM Screen Shot 2022-08-16 at 2 17 55 PM
    opened by alexpaul95 2
  • Multiple commands produce in XCode - 13

    Multiple commands produce in XCode - 13

    Hi,

    It is working in XCode - 12.4 not working in XCode - 13. It's giving like error, Please check it below.

    Multiple commands produce '/Users/company/Library/Developer/Xcode/DerivedData/My-esrwjowomlswatbgfwnunkkehaac/Build/Products/UAT Debug-iphonesimulator/MyApp.app/Frameworks/FMDB.framework':
    1) Target ‘My’ target has copy command from '/Users/company/Library/Developer/Xcode/DerivedData/My-esrwjowomlswatbgfwnunkkehaac/SourcePackages/checkouts/SharpsellCore/artifacts/FMDB.xcframework/ios-arm64_i386_x86_64-simulator/FMDB.framework' to '/Users/company/Library/Developer/Xcode/DerivedData/My-esrwjowomlswatbgfwnunkkehaac/Build/Products/UAT Debug-iphonesimulator/MyApp.app/Frameworks/FMDB.framework'
    2) That command depends on command in Target 'My': script phase “[CP] Embed Pods Frameworks”
    

    Check it below screenshot for [CP] Embed Pods Frameworks,

    Screenshot 2022-06-19 at 1 21 09 AM

    Check it below screenshot for the frameworks,

    Screenshot 2022-06-19 at 1 16 11 AM

    Check it below screenshot for the Pod file,

    # Uncomment the next line to define a global platform for your project
    platform :ios, '13.0'
    
    # Comment the next line if you don't want to use dynamic frameworks
    source "https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git" # needs to be first
    source "https://github.com/CocoaPods/Specs.git"
    
    use_frameworks!
    
    def common_pods
       # Pods for SalesForceSDK
       pod 'MobileSync'
       pod 'Firebase/Core'
       pod 'Firebase/Messaging'
       pod 'FirebaseAnalytics'
       pod 'Fabric', '~> 1.10.2'
       pod 'Crashlytics', '~> 3.14.0'
       pod 'Firebase/Analytics'
       pod 'AppCenter/Distribute'
       pod 'Alamofire', '~>  5.0.5'#, '~>  5.1.0'
    end
    
    target 'MyApp' do
    
       common_pods
      
       target 'MyAppTests' do
         inherit! :search_paths
         # Pods for testing
       end
      
       target 'MyAppUITests' do
         inherit! :search_paths
         # Pods for testing
       end
      
    end
    

    May I know where am i missing?

    Thanks in Advance 😊

    opened by SreekanthGudisi 0
  • Facing memory issue while fetching large data from db and app get crashed without crash log

    Facing memory issue while fetching large data from db and app get crashed without crash log

    In My App i have large size of json data. While storing the data its working fine. But, while fetching from db my memory size in Xcode showing around 2GB and app gets crashed.

    opened by Vaishu-26 1
  • fts

    fts

    Hello, I'm using Simple tokenizer,I insert a thousand data contains“德玛西亚”,But when I used "亚" to search, I couldn't find any data,can you help me?

    opened by yugaoxiang 3
  • FTS5 Custom Tokenize

    FTS5 Custom Tokenize

    let simpleTok = FMSimpleTokenizer(locale: nil) FMDatabase.registerTokenizer(simpleTok) db.installTokenizerModule(withName: "tokenizer1")

    SQL1: CREATE VIRTUAL TABLE IF NOT EXISTS 'Test' USING fts5(title, body, tokenize = 'tokenizer1') SQL2: CREATE VIRTUAL TABLE IF NOT EXISTS 'Test' USING fts4(title, body, tokenize = 'tokenizer1')

    When i use FTS5 in FMDB,I get an error like "no such tokenizer: tokenizer1". (SQL1) But it is succeed in FT4.(SQL2), how can i work it in FT5?

    opened by bluedaquiri 0
Releases(2.7.7)
  • 2.7.7(May 13, 2020)

    Improved:

    • Updated inline documentation so it appears in Xcode correctly
    • Rebuilt online documentation using jazzy
    • Fixed minor manual-reference-counting bug
    • Added API to allow rebinding of prepared statements
    • Fix web links to sqlite.org
    • Reduced inherent limitation of FMDBVersion; added warning re this limitation; gave examples how to use FMDBUserVersion to avoid problem altogether
    Source code(tar.gz)
    Source code(zip)
  • 2.7.4(Oct 26, 2017)

    A few fixes:

    • Fix a few nullability annotations https://github.com/ccgus/fmdb/commit/a76844e31768b9b76f2c5233d7ac38e12db4c7e1
    • Add support for immediate transactions https://github.com/ccgus/fmdb/commit/b4bd097249685da62b6a627bc3286273dbf9a284
    • Add explicit support for exclusive transactions, too https://github.com/ccgus/fmdb/commit/cb9284507706217deddbd5e148674ac9beeac793
    Source code(tar.gz)
    Source code(zip)
  • 2.7.2(Jun 26, 2017)

  • 2.7.1(Jun 5, 2017)

    • Adjust valueLong return type and resultLong parameter to suppress warning; and
    • Fix pointer comparison to avoid static analysis warning in columnIndexForName.
    Source code(tar.gz)
    Source code(zip)
  • v2.7(Jun 1, 2017)

Owner
August "Gus" Mueller
August
YapDB is a collection/key/value store with a plugin architecture. It's built atop sqlite, for Swift & objective-c developers.

YapDatabase is a collection/key/value store and so much more. It's built atop sqlite, for Swift & Objective-C developers, targeting macOS, iOS, tvOS &

Yap Studios 3.3k Dec 29, 2022
macOS Sqlite tableView 샘플 - objective c

목적 Objective C언어를 이용하여 macOS를 개발해본다. Sqlite를 이용하여 데이터를 저장하고, 불러와본다. FMDB를 이용한다. 데이터를 NSTableView를 이용하여 불러와본다. 추가적으로 NSOutlineView 구현해본다. 추가적으로 KVOCont

HyunSu Park 0 Jan 10, 2022
A Swift wrapper for SQLite databases

Squeal, a Swift interface to SQLite Squeal provides access to SQLite databases in Swift. Its goal is to provide a simple and straight-forward base API

Christian Niles 297 Aug 6, 2022
A stand-alone Swift wrapper around the mongo-c client library, enabling access to MongoDB servers.

This package is deprecated in favour of the official Mongo Swift Driver. We advise users to switch to that pack

PerfectlySoft Inc. 54 Jul 9, 2022
A stand-alone Swift wrapper around the MySQL client library, enabling access to MySQL servers.

Perfect - MySQL Connector This project provides a Swift wrapper around the MySQL client library, enabling access to MySQL database servers. This packa

PerfectlySoft Inc. 118 Jan 1, 2023
A stand-alone Swift wrapper around the libpq client library, enabling access to PostgreSQL servers.

Perfect - PostgreSQL Connector This project provides a Swift wrapper around the libpq client library, enabling access to PostgreSQL servers. This pack

PerfectlySoft Inc. 51 Nov 19, 2022
A stand-alone Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers.

Perfect - FileMaker Server Connector This project provides access to FileMaker Server databases using the XML Web publishing interface. This package b

PerfectlySoft Inc. 33 Jul 13, 2022
SQLite.swift - A type-safe, Swift-language layer over SQLite3.

SQLite.swift provides compile-time confidence in SQL statement syntax and intent.

Stephen Celis 8.7k Jan 3, 2023
A toolkit for SQLite databases, with a focus on application development

A toolkit for SQLite databases, with a focus on application development

Gwendal Roué 5.6k Jan 8, 2023
Realm is a mobile database: a replacement for Core Data & SQLite

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the iOS, macOS, tvOS & wa

Realm 15.7k Jan 1, 2023
Implement Student Admission System using SQlite

StudentAdmissionSQLiteApp Implement Student Admission System using SQlite. #Func

Hardik 2 Apr 27, 2022
BucketServer - Small API with SQLite database that saves notes for an iOS appliction called Bucket list

BucketList Server-Side Small API with SQLite database that saves notes for an iO

null 0 Dec 30, 2021
MagicData - A replacement of SQlite, CoreData or Realm.

MagicData A replacement of SQlite, CoreData or Realm. It is very easy to use and is a light version. Guides MagicData We use MagicData manage all the

Underthestars-zhy 20 Jul 4, 2022
Swift APIs for SQLite: Type-safe down to the schema. Very, very, fast. Dependency free.

Lighter Lighter is a set of technologies applying code generation to access SQLite3 databases from Swift, e.g. in iOS applications or on the server. L

Lighter.swift 330 Dec 26, 2022
An Objective-C wrapper for RocksDB - A Persistent Key-Value Store for Flash and RAM Storage.

ObjectiveRocks ObjectiveRocks is an Objective-C wrapper of Facebook's RocksDB - A Persistent Key-Value Store for Flash and RAM Storage. Current RocksD

Iskandar Abudiab 56 Nov 5, 2022
iForage helps foragers to track and manage foraging spots around them using CloudKit

iForage CloudKit Preface To expand on what I've created here: https://github.com/LynchConnor/iForage, I initially developed the app using Firebase. Th

Connor Lynch 3 Jul 14, 2022
Easy and beautiful way for a user to pick content, files or images. Written in Objective C

##JVTImageFilePicker Description ImageFilesPicker Is a butifuly designed UICompenent for uploading content Preview from recent camera roll Live Camera

Matan Abravanel 60 Jun 19, 2022
CoreData/Realm sweet wrapper written in Swift

What is SugarRecord? SugarRecord is a persistence wrapper designed to make working with persistence solutions like CoreData in a much easier way. Than

Modo 2.1k Dec 9, 2022
A lightweight wrapper over UserDefaults/NSUserDefaults with an additional layer of AES-256 encryption

SecureDefaults for iOS, macOS Requirements • Usage • Installation • Contributing • Acknowledgments • Contributing • Author • License SecureDefaults is

Victor Peschenkov 216 Dec 22, 2022