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

How do I make FMDB's database a singleton

I have been using SQLite for awhile now, and have decided to go to FMDB. I need to make it a singleton. Here's my code below; what do I have to change to have FMDB access the singleton d/b? #pragma mark Singleton Methods + (SQLiteDB *)…
SpokaneDude
  • 4,856
  • 13
  • 64
  • 120
4
votes
0 answers

XCcode9.3/iOS11.3 fmdb/sqlite will be crash

XCcode9.3 run project when First time In Debug, fmdb/sqlite crashes most of the time. some info is: "BUG IN CLIENT OF sqlite3.dylib: illegal multi-threaded access to database connection" Did some changes for iOS11.3?
lauren1573
  • 293
  • 1
  • 2
  • 9
4
votes
2 answers

iOS sqlcipher fmdb inTransaction “File is encrypted or is not a database”

When I encrypt my database using sqlcipher, and call inDatabase in FMDatabaseQueue——success! But When I change inDatabase to inTransaction, the console says "File is encrypted or is not a database". The code: FMDatabaseQueue *queue =…
saitjr
  • 159
  • 1
  • 9
4
votes
1 answer

Insert NULL with swift + FMDB

How do I insert NULL into a column with swift let myNullableValue: Double? = nil fmdb.executeUpdate( "INSERT INTO myTable(myNullableColumn) SELECT :myNullableValue" , withParameterDictionary: [ "myNullableValue": myNullableValue ])
Steven Wexler
  • 16,589
  • 8
  • 53
  • 80
4
votes
1 answer

Dictionary cannot be bridged from Objective-C -> Issues in Swift

I have been porting some objective-c code over into swift and I am trying to get the result set as a dictionary and then pack each dictionary (equivalent to a row from the db) into an array. But I am getting this error message "Dictionary cannot be…
Nate Uni
  • 933
  • 1
  • 12
  • 26
4
votes
3 answers

Warnings with a new Xcode project using FMDB, SqliteCipher and CocoaPods

I have installed CocoaPods.. and loaded the workspace as instructed. I am getting these warnings which I do not understand, here is an…
Nate Uni
  • 933
  • 1
  • 12
  • 26
4
votes
2 answers

Sqlite Issue with Bool values

I have a table with 3 Bool columns. Unseen Default 1 AnsweredCorrect Default 0 AnsweredWrong Default 0 Right now all Unseen rows are 1, AnsweredCorrect 0 and AnsweredWrong 0. Now I want to count all 3 columns for their ON values. I…
Ali Sufyan
  • 2,038
  • 3
  • 17
  • 27
4
votes
2 answers

How to select row in FMDB?

Friends I Used FMDB and it is working very well, but i tryed to select single row but it is gives me an error this is code FMResultSet *fResult= [db executeQuery:@"SELECT * FROM contents WHERE id = 1"]; [fResult next]; NSLog(@"%@",[fResult…
user3024320
4
votes
2 answers

Setting user_version in sqlite

I have seen other questions on here about reading the user_version, and that seems to be working fine for me. However I'm trying to use sqlite in FMDB to set my version number and it isn't setting. _db = [self openDatabase]; [_db…
HalR
  • 11,411
  • 5
  • 48
  • 80
4
votes
2 answers

FMDB and encryption

I'm using FMDB to work with sqlite and I'd prefer to avoid a dependency on SQLCipher. How can I simply leverage the DataProtection capability built into iOS? Is this possible - the only requirement is to protect the data in the event of the phone…
ConfusedNoob
  • 9,826
  • 14
  • 64
  • 85
4
votes
3 answers

Adding NULL Values to SQLite Database with FMDB and NSDictionary

I have run into a bit of a catch 22. I am using FMDB's fancy withParameterDictionary method to insert data into my SQLite database like this: NSDictionary *aircraftDict = [NSDictionary dictionaryWithObjectsAndKeys: …
Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
4
votes
1 answer

Getting the number of affected rows in FMDB updation query

I am updating my table with FMDB. How can i get total number of rows that updated. (Actually i have an issue. My update query is returning "true", even i have no data in that table.) Thanks in Advance. :)
shivam
  • 1,148
  • 1
  • 12
  • 28
4
votes
4 answers

SQLite. Can't add more than 1000 rows

I'm trying to add to my SQLite database (with fmdb) 10k rows but writing is stopped on 1000 row. And I have no any errors or warnings. My code: NSString *queryString = [NSString stringWithFormat:@"insert into histories (storyid, text, date,…
RomanHouse
  • 2,552
  • 3
  • 23
  • 44
4
votes
2 answers

FMDB, sqlite json-string into dictionary?

I load json-data from my server by using FMDB. The response I get (JSON), I'm storing in a sqlite-database (same string as the response below gets stored in the database). Later on I select that data from the database through FMDB and trying to…
nickelman
  • 702
  • 6
  • 24
4
votes
2 answers

FMDB sqlite insert failed

Coming from a non-SQL background, i create a simple table, named test, with 3 fields: NSString *testtable = @"create table if not exists test(testid integer primary key, userid integer, contentid text)"; if (![db executeUpdate:testtable]) { …