WCDB is a cross-platform database framework developed by WeChat.
WCTColumnCoding
support for all WCTValue
. Developers can use id<WCTColumnCoding>
objects for WINQ and all interfaces.//WINQ
NSDate *now = [NSDate date];
[database getObjectsOfClass:Message.class fromTable:tableName where:Message.modifedTime==now];
//Interfaces
[database updateAllRowsInTable:tableName
onProperty:Message.modifiedTime
withValue:[NSDate date]];
//SQL Execution Monitor
[WCTStatistics SetGlobalSQLTrace:^(NSString *sql) {
NSLog(@"SQL: %@", sql);
}];
WCTTableCoding
XCode file template for the best practice of isolating Objective C++ codes. See Wiki page for details.CursorWindow.windowSize(int)
static method to set or get default size for cursor windows.SQLiteDatabase.dump()
reports IDs for all threads that hold database connections, to aid dead-lock debugging.SQLiteTrace.onSQLExecuted(...)
reports negative execution time.NSData
or NSMutableData
column coding to raw data format. To be compatible with earlier versions, call[WCTCompatible sharedCompatible].builtinNSDataColumnCodingCompatibleEnabled = YES
attach
, detach
, vacuum
, savepoiint
, rollback
, release
, reindex
, explain
statement and SQLCipher related pragma to WINQ.insertOrReplace
.updateTable
to updateRowsInTable
, and statictics
(typo) to statistics
.[WCTDatabase canOpen]
never return YES.@autoreleasepool
in runTransaction
to avoid OOM.x86_64
ABI support.build.gradle
dependencies {
// Append ":debug@aar" to reference debug library.
compile 'com.tencent.wcdb:wcdb-android:1.0.1:debug@aar'
}
SQLiteCipherSpec cipher = new SQLiteCipherSpec()
// add the following line to enable device-locking
.setCipher(SQLiteCipherSpec.CIPHER_DEVLOCK);
SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(path, key, cipher, ...);
Initial release.