Questions tagged [fmdb]

FMDB is a free, third-party Objective-C wrapper for SQLite, providing a simple, object-oriented interface for Mac OS X and iOS.

FMDB is a free, third-party Objective-C wrapper for SQLite, providing a simple, object-oriented interface for Mac OS X and iOS. FMDB isolates the Objective-C developer from the SQLite C interface and greatly simplifies the process of writing code that interacts with SQLite databases.

FMDB was developed by August "Gus" Mueller and is provided the public free of charge for use without restriction. See the LICENSE.

References

678 questions
102
votes
1 answer

FMDBBlockSQLiteCallBackFunction Crash in app that's not using makeFunctionNamed

I'm working on an app that's in the app store, which uses FMDB for interacting with its sqlite database. We've received some crash reports with stack traces like this: Thread : Crashed: NSOperationQueue 0x170239c20 :: NSOperation 0x17024d7d0 (QOS:…
Greg
  • 32,510
  • 15
  • 88
  • 99
36
votes
6 answers

Core Data VS Sqlite or FMDB....?

Now this might look like a duplicate thread, but my question is that I have read a lot of questions like.. Core Data vs SQLite 3 and others but these are 2-3 years old. I have also read that FMDB was developed as core data was not supported on iOS,…
Ankit Srivastava
  • 11,975
  • 9
  • 57
  • 111
27
votes
4 answers

Best way to get the ID of the last inserted row on SQLite

On iPhone, what's the best way to get the ID of the last inserted row on an SQLite Database using FMDB ? Is there a better way rather than doing : SELECT MAX(ID)
vdaubry
  • 11,071
  • 7
  • 52
  • 76
24
votes
8 answers

FMDB SQLite question: row count of a query?

does anyone know how to return the count of a query when using FMDB? If I executeQuery @"select count(*) from sometable were..." I get an empty FMResultSet back. How can I get the row count of the query? Do I need to do a query like "select * from…
Fuggly
  • 895
  • 1
  • 7
  • 17
14
votes
6 answers

Passing an array to sqlite WHERE IN clause via FMDB?

Is it possible to pass an array to a SELECT … WHERE … IN statement via FMDB? I tried to implode the array like this: NSArray *mergeIds; // An array with NSNumber Objects NSString *mergeIdString = [mergeIds componentsJoinedByString:@","]; NSString…
Stefan
  • 1,011
  • 3
  • 11
  • 22
14
votes
1 answer

How to encrypt and decrypt using 'FMDB/SQLCipher' in Swift?

I have used FMDB to create a SQLite database in Swift. But now I want to encrypt it. So can anyone please help me with the Swift version of encrypting and decrypting SQLite database using 'FMDB/SQLCipher'? I was not able to find a good tutorial to…
Nuthan
  • 141
  • 4
14
votes
2 answers

Fastest way to insert many rows into sqlite db on iPhone

Can someone explain what the best way to insert a lot of data on the iPhone using FMDB is? I see things like using the beginTransaction command. I'm honestly not sure what this or setShouldCacheStatements do. I followed what code my coworker did…
Crystal
  • 25,222
  • 53
  • 203
  • 370
13
votes
1 answer

FMDB query isn't acting right with LIKE

I am using FMDB, which is a wrapper for SQLite. http://github.com/ccgus/fmdb Here is my query line: FMResultSet *athlete = [db executeQuery:@"SELECT * FROM athletes WHERE athlete_name LIKE ?", search_text]; Using this I can get a result back if I…
TheTC
  • 589
  • 7
  • 18
13
votes
2 answers

Using FMDB on multiple threads and two connections

I'm using two different types of fmdb connections in my app: FMDatabase for all READ queries and FMDatabaseQueue for all UPDATE queries. Both are handled by a singleton, which keeps both types open the whole time while the app is running. Both,…
achimsen
  • 611
  • 5
  • 10
10
votes
3 answers

Error when trying to use the SQLite wrapper FMDatabase

I'm having trouble when I try to use FMDatabase. I have added theese files: FMDatabaseQueue FMDatabaseAdditions FMDatabase FMResultSet FMDatabasePool ..and I have also added the libsqlite3.dylib library and imported FMDatabase.h, but as soon as I…
Stefan Edberg
  • 191
  • 2
  • 3
  • 13
10
votes
1 answer

FMDB resultset into dictionary

Is there an easy way to get the FMDB results of an executeQuery:SELECT * ... easily into a dictionary? FMResultSet *appointmentResults = [[DataClass getDB] executeQuery:@"SELECT * FROM Appointments WHERE date = ?",currDateString]; while…
Bot
  • 11,620
  • 10
  • 68
  • 127
10
votes
2 answers

FMDB ios no such table

I have a problem with a sqlite project that i'm doing, I'm using FMDB, I follow a simple example, but doesn´t work. And I can't find the error. I did my database schema from the terminal, I put some data on it. I'm very new to ios dev, so I don't…
Fede
  • 1,482
  • 3
  • 21
  • 36
9
votes
4 answers

iOS SQLite FMDB Transactions.. Correct usage?

I'm just going to try out using transactions with the FMDB SQLite iOS wrapper. The documentation is a little vague on transactions but from having a quick look at some functions I have come up with the following logic: [fmdb beginTransaction]; …
jim
  • 7,748
  • 11
  • 71
  • 144
9
votes
2 answers

ARC error with FMDB class after changes to building settings to compile SQLCipher

I followed the tutorial for compiling SQLCipher on iOS devices using a binary located here: http://sqlcipher.net/sqlcipher-binaries-ios-and-osx/ I've made several changes to build settings, adding header search path and C flags. Then after testing a…
Liban Abdulle
  • 187
  • 3
  • 12
8
votes
2 answers

Has apple now enabled FTS in the standard/built-in sqlite library?

I want to use FTS in my iOS project. Through some answers to questions here on SO (like this) and other sources (like this), i understood that i will have to roll out my own built of sqlite3 on iOS, thus replacing the dependency to default…
archeopetrix
  • 151
  • 2
  • 10
1
2 3
45 46