fmdb

FMDB, GCD vs NSOperationQueue

百般思念 提交于 2019-12-12 01:38:27
问题 I have a lot of data I need to insert in a two tables for my sqlite database. I want to put this work in the background. My flow basically goes like this: (pseudocode) while (files in database are not parsed) { if (fileType == type1) { parseType1; showProgress; } else { parseType2; showProgress; } } I got the most current version of FMDB and I thought I could enqueue my data like this: FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:[self databasePath]]; BOOL

Use core-data and sqlite c based api simultaneously on same db

会有一股神秘感。 提交于 2019-12-11 23:18:19
问题 AFAIK CoreData can be configured to use sqlite in the persistent store. so as core-data not provides way to query using SQL. So core-data has sqlite db in background. Is it safe to access same db using Core-Data and Sqlite c based api same time? Will it lead to any data corruption is sqllite or any threading issues. the reason why am I going to use any wrappers such as FMDB or C based API is to query complex data using sql query 回答1: It's probably safe but it's still a really bad idea. Core

How to take copy of FMResultset in FMDB Sqlite

人走茶凉 提交于 2019-12-11 18:18:14
问题 I tried to return the reference of FMResult object from a method and trying to access values from the returned object and couldn't able to access. So can anyone suggest how to return the FMResult object from method and access it from outside. Thanks in advance..... 回答1: You can use a reference to a FMResultSet elsewhere, however it must be used on the same thread where the original query was ran. Also, you can only iterate over the result set once. After you iterate, it will automatically

FMDB: Does calling a method to make a query in the inDatabase block work the same way?

空扰寡人 提交于 2019-12-11 16:19:58
问题 I'm trying to remove some database records, and I have a wrapper class around my FMDB class. What I'm wondering, is if I can call this class method from the inDatabase block? [_dbQueue inDatabase:^(FMDatabase *db) { // Do some magic here to get 1234 [myObject deleteWithId:1234]; // This calls executeUpdate:@"DELETE..." }]; 回答1: If you're using the latest FMDB, it should crash on you (if your other method is using inDatabase: as well). Recursive inDatabase: calls aren't advised. 来源: https:/

Undefined symbols for architecture i386 using libsqlite3.dylib with FMDB Xcode 7 ios9

本秂侑毒 提交于 2019-12-11 14:32:18
问题 I am using Xcode 7 and iOS 9 to create a simple app which saves the data and retrieves it using sqllite3. However I am getting the following error message while Building the app using libsqlite3.dylib library and FMDB retrieved from github. Undefined symbols for architecture i386: "_sqlite3_bind_blob", referenced from: -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o "_sqlite3_bind_double", referenced from: -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o "_sqlite3

memory usage increases dramatically after each FMDB query

时间秒杀一切 提交于 2019-12-11 08:02:05
问题 Below is my source code, every time I execute the function, the memory usage increases dramatically. Please help to point out what is the problem. func loadfontsFromDatabase(code:String)->[String] { let documentsPath : AnyObject = NSSearchPathForDirectoriesInDomains(.documentDirectory,.userDomainMask,true)[0] as AnyObject let databasePath = documentsPath.appending("/bsmcoding.sqlite") let contactDB = FMDatabase(path: databasePath as String) var c:[String]=[] let querySQL = "SELECT FONT FROM

Xcode failed to emit precompiled header?

前提是你 提交于 2019-12-11 06:57:24
问题 thanks in advance for the help you will give me. I have searched this for half a day over the internet yesterday and two hours now and I haven't found anything (more than those two links that did not help FMDatabase.h not found when using route-me library & Failed to emit precompiled header for bridging header) So here is my problem : I just had in hands a project that a previous developer has been working on, and when I try to launch it, here I have two errors : failed to emit precompiled

How to use FMDB on the generic iOS device instead of simulator?

淺唱寂寞╮ 提交于 2019-12-11 04:43:40
问题 I've created an app using Swift3 and Xcode8, and using FMDB as my database, when it runs on the simulator it can get the data from data.db ,but when it runs on the generic device (which is my phone), there's no data in the tableView, also could't insert records. I added data.db into my project, but when I changed records on simulator, records in data.db didn't change, but I printed the path, it pointed to simulator folder, database in that folder will changed along the modify in simulator and

Correct parameter binding for SELECT WHERE .. LIKE using fmdb?

自古美人都是妖i 提交于 2019-12-10 17:49:29
问题 First time user of fmdb here, trying to start off doing things correctly. I have a simple single table that I wish to perform a SELECT WHERE .. LIKE query on and after trying several of the documented approaches, I can't get any to yield the correct results. e.g. // 'filter' is an NSString * containing a fragment of // text that we want in the 'track' column NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:filter, @"filter", nil]; FMResultSet *results = [db executeQuery:@

(1)知识准备【利用objective-c的runtime特性,结合FMDB实现一个轻量级的ORM】

穿精又带淫゛_ 提交于 2019-12-10 17:43:59
版权声明:本文为博主原创文章,未经博主允许不得转载。 ( 本ORM的源码已经上传到 github 上 ( https://github.com/helloclq/BCSqliteORM_FMDB ),大家可以下载测试,如发现什么问题或意见,欢迎大家提出并指正, oschina上的地址为: http://git.oschina.net/BlockCheng/BCSqliteORM_FMDB ) 想自己写一个objective-c的框架:利用objective-c的runtime特性,结合现有的操作sqlite的FMDB库,实现一个轻量级的ORM框架;要求: 颗粒度小、 量级轻、可配置度高、自由性大; 0、需求缘由 一个人扛这个项目快两年了,最近在着手重构代码,想精简下现有的数据库层的代码。 目前项目的数据库层的情况是这个样子的:项目中共涉及的表有8张,数据库的操作,都是通过FMDB操作Sql直接实现的,都是纯粹的objective-c实体和数据库表间的映射操作,如下图。 项目中,一张表,一个实体,对应一个DBManager类别,而各个类别里面的操作无非都是增删改查,类别里大致操作流程是: 【增删改】:根据objective-c实体信息,手动生成sql,然后经由FMDB,直接操作放进sqlite 【查】:根据查询条件,手动生成sql,利用FMDB操作sqlite,得到查询结果