Skip to content

Commit

Permalink
initial project
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Sep 4, 2008
0 parents commit c5f6eb7
Show file tree
Hide file tree
Showing 11 changed files with 1,719 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
build
*.mode1v3
*.pbxuser
Binary file not shown.
245 changes: 245 additions & 0 deletions fmdb-migration-manager.xcodeproj/project.pbxproj
@@ -0,0 +1,245 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {

/* Begin PBXBuildFile section */
D2AAC0CC05546C4400DB518D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
32DBCF5E0370ADEE00C91783 /* fmdb-migration-manager_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "fmdb-migration-manager_Prefix.pch"; sourceTree = "<group>"; };
D2A6134D07B89F6200DD23D3 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
D2AAC0C705546C1D00DB518D /* fmdb-migration-manager.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "fmdb-migration-manager.dylib"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
D2AAC0C505546C1D00DB518D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D2AAC0CC05546C4400DB518D /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
034768DFFF38A50411DB9C8B /* Products */ = {
isa = PBXGroup;
children = (
D2AAC0C705546C1D00DB518D /* fmdb-migration-manager.dylib */,
);
name = Products;
sourceTree = "<group>";
};
0867D691FE84028FC02AAC07 /* fmdb-migration-manager */ = {
isa = PBXGroup;
children = (
08FB77AEFE84172EC02AAC07 /* Classes */,
32C88DFF0371C24200C91783 /* Other Sources */,
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
034768DFFF38A50411DB9C8B /* Products */,
);
name = "fmdb-migration-manager";
sourceTree = "<group>";
};
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */,
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */,
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
};
08FB77AEFE84172EC02AAC07 /* Classes */ = {
isa = PBXGroup;
children = (
);
name = Classes;
sourceTree = "<group>";
};
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
0867D6A5FE840307C02AAC07 /* AppKit.framework */,
D2A6134D07B89F6200DD23D3 /* CoreData.framework */,
0867D69BFE84028FC02AAC07 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
315E9EEF0E6FF8D6000A84C0 /* fmdb */ = {
isa = PBXGroup;
children = (
);
name = fmdb;
sourceTree = "<group>";
};
32C88DFF0371C24200C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
315E9EEF0E6FF8D6000A84C0 /* fmdb */,
32DBCF5E0370ADEE00C91783 /* fmdb-migration-manager_Prefix.pch */,
);
name = "Other Sources";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
D2AAC0C305546C1D00DB518D /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
D2AAC0C605546C1D00DB518D /* fmdb-migration-manager */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB917D08733D990010E9CD /* Build configuration list for PBXNativeTarget "fmdb-migration-manager" */;
buildPhases = (
D2AAC0C305546C1D00DB518D /* Headers */,
D2AAC0C405546C1D00DB518D /* Sources */,
D2AAC0C505546C1D00DB518D /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = "fmdb-migration-manager";
productName = "fmdb-migration-manager";
productReference = D2AAC0C705546C1D00DB518D /* fmdb-migration-manager.dylib */;
productType = "com.apple.product-type.library.dynamic";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB918108733D990010E9CD /* Build configuration list for PBXProject "fmdb-migration-manager" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* fmdb-migration-manager */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
D2AAC0C605546C1D00DB518D /* fmdb-migration-manager */,
);
};
/* End PBXProject section */

/* Begin PBXSourcesBuildPhase section */
D2AAC0C405546C1D00DB518D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
1DEB917E08733D990010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "fmdb-migration-manager_Prefix.pch";
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = "fmdb-migration-manager";
};
name = Debug;
};
1DEB917F08733D990010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "fmdb-migration-manager_Prefix.pch";
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = "fmdb-migration-manager";
};
name = Release;
};
1DEB918208733D990010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.5;
};
name = Debug;
};
1DEB918308733D990010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = macosx10.5;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
1DEB917D08733D990010E9CD /* Build configuration list for PBXNativeTarget "fmdb-migration-manager" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB917E08733D990010E9CD /* Debug */,
1DEB917F08733D990010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB918108733D990010E9CD /* Build configuration list for PBXProject "fmdb-migration-manager" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB918208733D990010E9CD /* Debug */,
1DEB918308733D990010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
}
7 changes: 7 additions & 0 deletions fmdb-migration-manager_Prefix.pch
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'fmdb-migration-manager' target in the 'fmdb-migration-manager' project.
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
111 changes: 111 additions & 0 deletions fmdb/FMDatabase.h
@@ -0,0 +1,111 @@
#import <Foundation/Foundation.h>
#import "sqlite3.h"
#import "FMResultSet.h"

@interface FMDatabase : NSObject
{
sqlite3* db;
NSString* databasePath;
BOOL logsErrors;
BOOL crashOnErrors;
BOOL inUse;
BOOL inTransaction;
BOOL traceExecution;
BOOL checkedOut;
int busyRetryTimeout;
BOOL shouldCacheStatements;
NSMutableDictionary *cachedStatements;
}


+ (id)databaseWithPath:(NSString*)inPath;
- (id)initWithPath:(NSString*)inPath;

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

// encryption methods. You need to have purchased the sqlite encryption extensions for these to work.
- (BOOL) setKey:(NSString*)key;
- (BOOL) rekey:(NSString*)key;


- (NSString *) databasePath;

- (NSString*) lastErrorMessage;

- (int) lastErrorCode;
- (BOOL) hadError;
- (sqlite_int64) lastInsertRowId;

- (sqlite3*) sqliteHandle;

- (BOOL) executeUpdate:(NSString *)sql arguments:(va_list)args;
- (BOOL) executeUpdate:(NSString*)sql, ...;

- (id) executeQuery:(NSString *)sql arguments:(va_list)args;
- (id) executeQuery:(NSString*)sql, ...;

- (BOOL) rollback;
- (BOOL) commit;
- (BOOL) beginTransaction;
- (BOOL) beginDeferredTransaction;

- (BOOL)logsErrors;
- (void)setLogsErrors:(BOOL)flag;

- (BOOL)crashOnErrors;
- (void)setCrashOnErrors:(BOOL)flag;

- (BOOL)inUse;
- (void)setInUse:(BOOL)value;

- (BOOL)inTransaction;
- (void)setInTransaction:(BOOL)flag;

- (BOOL)traceExecution;
- (void)setTraceExecution:(BOOL)flag;

- (BOOL)checkedOut;
- (void)setCheckedOut:(BOOL)flag;

- (int)busyRetryTimeout;
- (void)setBusyRetryTimeout:(int)newBusyRetryTimeout;

- (BOOL)shouldCacheStatements;
- (void)setShouldCacheStatements:(BOOL)value;

- (NSMutableDictionary *)cachedStatements;
- (void)setCachedStatements:(NSMutableDictionary *)value;


+ (NSString*) sqliteLibVersion;



@end

@interface FMStatement : NSObject {
sqlite3_stmt *statement;
NSString *query;
long useCount;
}


- (void) close;
- (void) reset;

- (sqlite3_stmt *)statement;
- (void)setStatement:(sqlite3_stmt *)value;

- (NSString *)query;
- (void)setQuery:(NSString *)value;

- (long)useCount;
- (void)setUseCount:(long)value;



@end

0 comments on commit c5f6eb7

Please sign in to comment.