//
//  DatabaseMgr.h
//  Macalline
//
//  Created by JianjiYuan on 14-12-4.
//  Copyright (c) 2014年 JianjiYuan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <FMDBHelpers.h>
#import <FMDB.h>

#define kTable_Image            @"t_image"
#define kTable_CheckPoint       @"t_checkpoint"

@interface DBInstance : NSObject
{
    FMDatabase* _db;
    FMDatabaseQueue* _dbQueue;
}

+ (instancetype)getInstance;

- (FMDatabaseQueue *)queue;
- (FMDatabase *)db;

// 删除数据库
- (void)deleteDatabse;
// 判断是否存在表
- (BOOL)isTableOK:(NSString *)tableName;
// 获得表的数据条数
- (BOOL)getTableItemCount:(NSString *)tableName;
// 创建表
- (BOOL)createTable:(NSString *)tableName withArguments:(NSString *)arguments;
// 删除表-彻底删除表
- (BOOL)deleteTable:(NSString *)tableName;
// 清除表-清数据
- (BOOL)eraseTable:(NSString *)tableName;


@end
