//
//  DBOperation.h
//  zhuxun
//
//  Created by winsoft on 17/4/24.
//
//

#import <Foundation/Foundation.h>
/**
 *  数据库实现底层, sql语句由业务层传入.
 */
@interface DBOperation : NSObject

+ (instancetype)dbOperationWithPath:(NSString *)path;

//- (void)creatDBbySQL:(NSString *)sql Path:(NSString *)path;
- (void)creatDBWithTableName:(NSString *)tableName dbModelClass:(Class)dbModelClass Path:(NSString *)path autoUpgrade:(BOOL)autoUpgrade uniqueCloumName:(NSString *)uniqueCloumName;
//插入模型
- (void)addDataDBWithTableName:(NSString *)tableName model:(id)model;
- (void)addDatasDBWithTableName:(NSString *)tableName models:(NSArray *)models;

- (void)addDataToDBWithSQL:(NSString *)sql;

//事务批量插入
- (void)addDatasToDBWithSQLs:(NSArray *)sqls;
//查询
- (void)quaryDBbySQL:(NSString *)sql result:(void(^)(NSMutableArray *array))result;
@end
