Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 66 lines (49 sloc) 1.156 kb
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
//
// SQLDatabase.h
// An objective-c wrapper for the SQLite library
// available at http://www.hwaci.com/sw/sqlite/
//
// Created by Dustin Mierau on Tue Apr 02 2002.
// Copyright (c) 2002 Blackhole Media, Inc. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "sqlite/sqlite3.h"

@class SQLResult;
@class SQLRow;

@interface SQLDatabase : NSObject
{
sqlite3 * mDatabase;
int lastError;
NSString * mPath;
}

+ (id)databaseWithFile:(NSString*)inPath;
-(id)initWithFile:(NSString*)inPath;

-(int)lastError;

-(BOOL)open;
-(void)close;

+ (NSString*)prepareStringForQuery:(NSString*)inString;
-(SQLResult*)performQuery:(NSString*)inQuery;
-(SQLResult*)performQueryWithFormat:(NSString*)inFormat, ...;

-(int)lastInsertRowId;

@end

@interface SQLResult : NSObject
{
char** mTable;
int mRows;
int mColumns;
}

-(int)rowCount;
-(int)columnCount;

-(SQLRow*)rowAtIndex:(int)inIndex;
-(NSEnumerator*)rowEnumerator;

@end

@interface SQLRow : NSObject
{
char** mRowData;
char** mColumns;
int mColumnCount;
}

-(int)columnCount;

-(NSString*)stringForColumn:(NSString*)inColumnName;
-(NSString*)stringForColumnAtIndex:(int)inIndex;

@end
Something went wrong with that request. Please try again.