这里是文章模块栏目内容页
sqlitec封装

#import

#import "/usr/include/sqlite3.h"

@interface FMDatabase : NSObject {

sqlite3* _db;

NSString* _databasePath; //路径及文件名称,如果不传入则是内存数据库

BOOL _logsErrors; //是否在错误时打印信息。有助于debug问题的时候

BOOL _crashOnErrors; //如何遇到error,是crash还是处理释出一个 error message 并return。当然想要 crash 的话,开发者必须 crashes 时包含整个 context (callstack 和 log messages) 以便于 bugfixing。 default is NO (default, crash on errors).

BOOL _traceExecution;// whether to trace execution time of every sql statement executed by the database class. This can be useful for tuning performance as well as debugging unexpected behavior in production systems. Unfortunately, it does slow down db operations slightly when enabled, so you will probably want to disable it if you are not doing any real-time analysis / optimization of your code with this flag set to YES (Default: NO).

}

-(id)initWithPath:(NSString*)inPath ;//实例化对象并更新 路径及文件名称 若不传入inpath表明使用内存数据库

-(BOOL)open;//打开此路径上的数据库文件或者创建此路径上的数据库文件

+(FMDatabase*)databaseWithPath:(NSString*)aPath ;//实例化对象并更新 路径及文件名称 同上方法 initwithpath: ,但返回值为 Fmdatabase* 也就是 self . --->已根部initwithpath: 来实现<--- 2017-09-01 11:02 updateed![image]() ![image]( "img")


####2017-09-01 10:54 updated! [image]() [image]( "img")

-(void)close ;

将相关的对象、Statement、Prepared Statement 都close   -->已根部dealloc来实现<--- 2017-09-01 11:03 updateed![image]() ![image](