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
0
votes
1 answer

Ifnull using FMDB

I've just switched my iOS app from using plain SQLite to using FMBD. It's going great and I am a big fan. The only problem I'm having is that I have used the ifnull function in a number of my old SQLite calls, and it doesn't seem to work with FMDB.…
shmozzle
  • 15
  • 5
0
votes
1 answer

FMDatabase connection

I am working with FMDatabase in my iOS app but I am opening a new connection on almost every query that I need to do. For example in my CategoryDAO getCategoriesForArticle method I open a new connection. In my ArticleDAO getArticle I open a new…
iVela
  • 1,160
  • 1
  • 19
  • 40
0
votes
1 answer

Objective-C: coping and deleting files (FileManager)

I'm working with a sqlite database application using FMDatabase. I want to update a table of a database located in the main bundle NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:db_name]; with data in…
Spale350z
  • 15
  • 4
0
votes
1 answer

Bind parameter in FROM clause in SQLite

Is it possible to bind a parameter in the FROM clause of a query to SQLite? How? If not, why? Any alternatives? Here is what I want to do in my iOS application: - (BOOL)existsColumn:(NSString *)column inTable:(NSString *)table ofDatabase:(FMDatabase…
tboyce12
  • 1,449
  • 14
  • 28
0
votes
1 answer

How to check username and password is correct or not in sqlite FMBD

I want to check if the user has entered correct username and password or not. i have created the database with many username and passwords. Thanks in advance. -(IBAction)LoginPressed:(id)sender{ arrayofusername = [[NSMutableArray alloc] init]; …
0
votes
3 answers

FMDatabase locked, best practice for usage within class

I have a sync method for an app I'm building storing data in SQLite locally, using the FMDatabase wrapper. When I put all the queries in one class everything works fine. However to maintain complexity I added some data controller classes for parts…
Tum
  • 6,937
  • 2
  • 25
  • 23
0
votes
1 answer

SQLCipher + FMDB performence is poor on iOS device

I used SQLCipher to encrypt sqlite database and used FMDB for performing sqlite operation on encrypted database by using [FMDB setKey:] call. My application work slowly when I used SQLCipher with FMDB on encrypted database. If I used only FMDB on…
JKMania
  • 239
  • 1
  • 6
  • 17
0
votes
1 answer

FMDB - executeQuery Unable to provide paramaters

Code that works: A) FMResultSet *r = [self.db executeQuery:@"SELECT COUNT(*) FROM myDB"]; What I want to work: B) r = [self.db executeQuery:@"SELECT COUNT(*) FROM ?",@"myDB"]; The error when using B: DB Error: 1 "near "?": syntax error" DB Query:…
Reed
  • 14,703
  • 8
  • 66
  • 110
0
votes
1 answer

Sqlite3 database in objective-c [need advice]

I am using FMDB lib to store messages (chat application). It's a objective-c wrapper for sqlite3. I have singleton where all queries implemented. Just example: NSString *query = [NSString stringWithFormat:@"UPDATE table_name SET some_col =…
Zhans
  • 273
  • 2
  • 11
0
votes
1 answer

Database locked using FMDB for iOS

First of all, I'd like to say that I'm really having a bad time trying to configure and use my SQLite DB in a background thread so that the main thread is not blocked. After I found a little guide somewhere on the Internet, I've decided to go for…
Aleph72
  • 877
  • 1
  • 13
  • 40
0
votes
1 answer

FMDatabase: connect DB made in advance

I made dbfile sample.db by terminal in advance, and added the file to the project. But the App create a dbfile from scratch, instead of refering to the db added. How do I need to fix to refer the db added? NSArray* paths =…
kusumoto_teruya
  • 2,415
  • 4
  • 23
  • 38
0
votes
1 answer

Query filtering based on dates using FMDB?

How do I query games that are after a "visible" date? The dateformat is set: FMDatabase *db = self.database; if([self.database open]){ [db beginTransaction]; NSDateFormatter *formatter = [NSDateFormatter new]; [formatter…
jacob
  • 541
  • 1
  • 9
  • 19
0
votes
1 answer

Checking if an row exist after a certain record or before a certain record in FMDB

I am making an app which requires me to do traverse through a list of data which are stored in internal SQLite database. I am using FMDB for all database operation in my app.I want my "next" and "previous" available if the shown data has next record…
Saty
  • 2,563
  • 3
  • 37
  • 88
0
votes
1 answer

FMDB - Improve FMResultSet speed

This code take a very long time to run. I have roughly 100,000 records. Each step takes roughly the same mount of time.... get the result from FMResultSet and reading it into the 3 arrays. I tried using two select statements. One to get the…
CrazyGoose
  • 51
  • 1
  • 10
0
votes
1 answer

multithreading issues with FMDB

I am new to FMDB, I am using FMDBQueue to avoid any threading issues, but for some reason when it try to get the data from and operation queue, it is going to semaphore wait. I have attached a thread stack, can someone please check it and help me…
Vijay
  • 420
  • 6
  • 18