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

677 questions
6
votes
1 answer

When to close SQLite database (using FMDB)

When should you close the connection to an SQLite database (using [db close] in FMDB)? Right now I am closing it after running every batch of related queries, but should I rather close when my app closes? What are the pros/cons of doing either…
Souleiman
  • 3,360
  • 4
  • 23
  • 21
5
votes
1 answer

Use two FMDB queues (read / write) on the same database

I believe that my use case is fairly common, but I could not find an authoritative answer for this. I have a sync mechanism that runs in background and write data to my database. This sync can take a lot of time (I use FTS). For this I use a…
Jonas Schmid
  • 5,360
  • 6
  • 38
  • 60
5
votes
1 answer

va_args() causing EXC_BAD_ACCESS

I'm getting a EXC_BAD_ACCESS when using va_args (iOS 7, Xcode 5.1.1, ARC on): // ... int val = sqlIntQuery(@"format_string", @"arg1"); // <-- does not work int val = sqlIntQuery(@"format_string", @"arg1", nil); // <-- this works //…
Jeff
  • 2,659
  • 1
  • 22
  • 41
5
votes
2 answers

FMDB: is It good remaininig open database during the whole life cycle of ios app?

I am confused about database open and close operation for FMDB wrapper class. Is it creating issue if i open database in applicationDidFinishLoading method of AppDelegate class and do not close until application will terminate ? Thanks.
Nikh1414
  • 1,238
  • 2
  • 19
  • 35
5
votes
4 answers

Is there a tutorial about how to use FMDB, the sqlite3 wrapper class?

The FMDB page just offers the cvs checkout. Maybe someone out there wrote a good tutorial on how to use FMDB with sqlite3 on the iphone?
HelloMoon
5
votes
1 answer

Keeping FMDB thread safe

I see in FMDB 2.0, the author added FMDatabaseQueue for threads. The example is: // First, make your queue. FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath]; Then use it like so: [queue inDatabase:^(FMDatabase *db) { [db…
Crystal
  • 28,460
  • 62
  • 219
  • 393
5
votes
1 answer

How can I use FMDB as a Framework in an iPad application?

I am currently developing an iPad application. At one stage, there is a series of sliders and buttons, when you press the button, it stores the value of the slider into a table. First of all, I need to use SQLite to manage the database. I found a…
Tristan
  • 65
  • 4
  • 9
5
votes
2 answers

sqlite3 and fmdb nested FMResultSet is possible?

I'm trying to iterator through a master detail sort of tables and I'd like to populate the master/detail structures as I go. Apparently when I nest result sets I get a BAD Access exception: FMDatabase *db = self.database; [db…
4
votes
3 answers

FMDB Query with dictionary

I need to run a query that looks would look like INSERT INTO Appointments (field1, field2, field3, ..., field30) VALUES (value1, value2, value3, ..., value30) I have my Appointments being stored inside a Dictionary and would like to loop through…
Bot
  • 11,868
  • 11
  • 75
  • 131
4
votes
2 answers

Convert FMResultSet to NSMutableArray?

I am trying out FMDB and it looks like it will work perfectly for me IF I can get my FMResultSet turned into an NSMutableArray. How would I accomplish this?
Slee
  • 27,498
  • 52
  • 145
  • 243
4
votes
2 answers

FMDB executeUpdate DROP command does halt the app

I want to drop a table in my SQLite Database file named database.db. After using NSLog(@"i show up in the console"); [db executeUpdate:@"DROP TABLE IF EXISTS `article`;"]; NSLog(@"i will not show up in the console"); the app stops at the position…
TRD
  • 1,027
  • 11
  • 20
4
votes
1 answer

sections and index in UITableView from Sqlite (FMDB)

I am trying to get the sections and index for UITableView from Sqlite (I am using FMDB as the wrapper). I just can't seem to figure out where to start. I can read the information back from the DB and store it in a NSMutableArray. I have tried the…
Mush
  • 185
  • 1
  • 2
  • 12
4
votes
2 answers

"Apple Mach-O (id) linker" error when adding external libraries to project

I added FMDB to my project then added the frameworks libsqlite3.dylib and libsqlite3.0.dylib, but I still get the build error. If I remove the FMDB classes from my project then it builds just fine. What other things should I check? Detailed info on…
user810606
4
votes
2 answers

Problem with FMDB and insert value in the "executeQuery:" from a searchString

While building a Search for my app i ran into a problem whilst using the FMDB SQLite Wrapper (https://github.com/ccgus/fmdb). When I search my database with this SQL Command, everything is fine. 13 objects are returned and I can use…
Steven David
  • 704
  • 7
  • 14
4
votes
1 answer

SQLite: DB error, "out of memory"

I am using FMDB to create and add a record to a d/b. The method to create the d/b is: //----------------------- checkIfDatabaseExists -----------------| + (void) openCreateDB { NSArray *searchPaths =…
SpokaneDude
  • 4,856
  • 13
  • 64
  • 120
1 2
3
45 46