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
8
votes
3 answers

Multiple Queries not Running in FMDB

I'm using FMDB to create a SQLite database on iPhone. I have a initial.sql that is of the form CREATE TABLE Abc ... ; CREATE TABLE Def ... ; I load this by loading the file into an NSString and running it NSString * str = // string from file…
George
  • 1,447
  • 11
  • 26
8
votes
3 answers

FMDB: add new column and insert data

In my app I'm using FMDatabase. I'm trying to add new column to existing table and then insert data in that column. When I added the column by Alter Table, I got no errors but when I'm trying to insert data in the table, I got error complaining…
Sawsan
  • 998
  • 9
  • 20
8
votes
2 answers

FMDatabaseQueue How To Return A Value

I'm using FMDatabaseQueue in my iOS application. I'm stuck in understanding how to return the value upon creating the queue. Appreciate your help!! FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath]; [queue…
Ethan Sakhai
  • 101
  • 1
  • 3
7
votes
4 answers

Error when detaching SQLite database - database is locked

I have a system that is based on the SQLite database. Each client has a local database, and once in a while the update arrives from the main server, just a small delta .db file. The task is to merge to local database with the delta file, the schema…
lawicko
  • 6,966
  • 2
  • 34
  • 47
7
votes
2 answers

Table not found after adding preloaded sqlite db to iOS App using Xcode

I have a preloaded SQLite database, named "myDB.dms". I want to package the DB and access the contents from within the app. So to that first, I dragged and dropped the DB file in my Xcode ProjectNavigator window and on a prompt I click on "Copy…
Rookie
  • 698
  • 3
  • 10
  • 28
7
votes
4 answers

EXC_BAD_ACCESS when using SQLite (FMDB) and threads on iOS 4.0

I am using FMDB to deal with my database which works fine. The app uses a background thread which is doing some work and needs to access the database. At the same time the main thread needs to run some queries on the same database. FMDB itself has a…
danielkbx
  • 115
  • 1
  • 4
7
votes
3 answers

Fetching complex data using FMDB

I am using SQLite in an iOS application and I am using FMDB as a wrapper. This is my database schema : CREATE TABLE Offer (code TEXT PRIMARY KEY NOT NULL, name TEXT); CREATE TABLE OffreMarket (codeOffer TEXT NOT NULL, codeMarket TEXT NOT…
samir
  • 4,316
  • 6
  • 44
  • 75
7
votes
2 answers

How to save & retrieve NSdata into sqlite through FMDB

How can I save NSData into sqlite, I am using FMDB wrapper for saving data. Below is the code which I have tried so far For saving NSData *data = [NSKeyedArchiver archivedDataWithRootObject:model.expertArray];; NSString *query = [NSString…
DAMM108
  • 970
  • 2
  • 13
  • 27
7
votes
4 answers

How to delete a row in a sqlite database table?

I am using fmdb for managing my database. I could not find any example for deleting a row from a table in fmdb. I tried NSString *sqlStat=@"DELETE from tableName WHERE id=3"; FMResultSet *rs = [database executeQuery:sqlStat]; but its not…
MAX
  • 71
  • 1
  • 1
  • 2
7
votes
3 answers

SQLite FMDB creating table - beginner iOS

I think this is a simple question but I didnt find the answer in the FMDB git page. When you use the command: [database executeUpdate:@"create table T_table(name text primary key, age int)"]; does FMDB or SQLite make some kind of verification to…
pedros
  • 1,197
  • 10
  • 18
6
votes
1 answer

Where to locate Sqlite database in Xcode project

Sorry for repeating a question albeit slightly differently but I've tried everything, searched this forum and google but can't solve this issue. I have a Sqlite database (only 20kb size) which I want to use in a Swift 4 project using Xcode. I've…
RobM
  • 101
  • 8
6
votes
3 answers

swift 3.0 How can I access `AnyHashable` types in `Any` in Swift 3?

I'm using sqlite file to get the diaryEntriesTeacher from the authorId. it generates the following object of authorId when I print the variable authorId is nil Code :- func applySelectQuery() { checkDataBaseFile() objFMDB =…
Jayprakash Singh
  • 1,199
  • 2
  • 11
  • 26
6
votes
2 answers

"Too many files open" issue used by FMDatabase/SQLite3

I am using the FMDatabase wrapper for SQLite3 in my OSX App. I do tons of inserts into the database: FMResultSet *results; results= [db executeQuery:@"select count(*) from `items` where key = ?",[keyPath lowercaseString],nil]; while([results…
JeremyLaurenson
  • 939
  • 2
  • 10
  • 21
6
votes
2 answers

Swift - Pre-populated SQLite database not included on device

I am trying to include a pre-populated SQLite database (with FMDB wrapper) in a build to my physical iPhone. However, the pre-populated database is not being included in the build to the physical device. Note that it works fine in the IOS…
IlludiumPu36
  • 3,998
  • 8
  • 52
  • 87
6
votes
3 answers

FMDatabase + swift + request with undefined number of arguments

I'm trying to send a request to FMDB via a Swift class. This is working: self.database.executeQuery("SELECT * FROM foods WHERE id = ?", withArgumentsInArray:[anID]) because I used the method executeQuery(sql, withArgumentsInArray) But I don't know…
alex.bour
  • 2,534
  • 6
  • 37
  • 60
1
2
3
45 46