-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathSQLiteManager.h
More file actions
30 lines (24 loc) · 938 Bytes
/
SQLiteManager.h
File metadata and controls
30 lines (24 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
// SQLiteManager.h
//
// Created by Anthony Ly on 11/03/12.
// Copyright (c) 2012 AnthonyLy.com. All rights reserved.
//
/***** Define your database file here *****/
#define databaseName @"database.sqlite"
#import <Foundation/Foundation.h>
#import <sqlite3.h>
@interface SQLiteManager : NSObject{
NSString *databasePath;
}
+(SQLiteManager *)singleton;
-(void) checkAndCreateDatabaseWithOverwrite:(BOOL)overwriteDB;
#pragma SQL : SQL METHOD
-(NSArray *)findAllFrom:(NSString *)table;
-(NSArray *)find:(NSString *)field from:(NSString *)table where:(NSString *)condition;
-(NSArray *)find:(NSString *)field from:(NSString *)table where:(NSString *)condition order:(NSString *)order limit:(NSString *)limit;
-(BOOL)save:(NSMutableDictionary *)data into:(NSString *)table;
-(BOOL)deleteRowWithId:(int)idRow from:(NSString *)table;
-(id)executeSql:(NSString *)sql;
@property(nonatomic, retain) NSString *databasePath;
@end