wcdb
WCDB 2.1.9
中文版本請參看這裡
WCDB是微信應用程序中使用的高效,完整,易於使用的移動數據庫框架。它基於sqlite和sqlcipher,並支持五種語言:C ++,Java,Kotlin,Swift和Objective-C。
使用ORM和Winq,您可以在一個行代碼中插入,更新,查詢和刪除對象:
// C++
database.insertObjects<Sample>(Sample( 1 , " text " ), myTable);
database.updateRow( " text2 " , WCDB_FIELD(Sample::content), myTable, WCDB_FIELD(Sample::id) == 1 );
auto objects = database.getAllObjects<Sample>(myTable, WCDB_FIELD(Sample::id) > 0 );
database.deleteObjects(myTable, WCDB_FIELD(Sample::id) == 1 ); // Java
database . insertObject ( new Sample ( 1 , "text" ), DBSample . allFields (), myTable );
database . updateValue ( "text2" , DBSample . content , myTable , DBSample . id . eq ( 1 ));
List < Sample > objects = database . getAllObjects ( DBSample . allFields (), myTable , DBSample . id . gt ( 0 ));
database . deleteObjects ( myTable , DBSample . id . eq ( 1 )); // Kotlin
database.insertObject< Sample >( Sample ( 1 , " text " ), DBSample .allFields(), myTable)
database.updateValue( " text2 " , DBSample .content, myTable, DBSample .id.eq( 1 ))
val objects = database.getAllObjects< Sample >( DBSample .allFields(), myTable, DBSample .id.gt( 0 ))
database.deleteObjects(myTable, DBSample .id.eq( 1 ))// Swift
try database . insert ( Sample ( id : 1 , content : " text " ) , intoTable : myTable )
try database . update ( table : myTable ,
on : Sample . Properties . content ,
with : " text2 "
where : Sample . Properties . id == 1 )
let objects : [ Sample ] = try database . getObjects ( fromTable : myTable ,
where : Sample . Properties . id > 0 )
try database . delete ( fromTable : myTable where : Sample . Properties . id == 1 ) // Objc
[database insertObject: sample intoTable: myTable];
[database updateTable: myTable
setProperty: Sample.content
toValue: @" text2 "
where: Sample. id == 1 ];
NSArray * objects = [database getObjectsOfClass: Sample.class
fromTable: myTable
where: Sample. id > 0 ];
[database deleteFromTable: myTable where: Sample. id == 1 ];通過框架層和SQLCIPHER源優化,WCDB具有更有效的性能。
WCDB總結了實踐中的常見問題,為數據庫開發提供了更完整的開發經驗:
WCDB具有五種語言的接口:C ++,Java,Kotlin,Swift和OBJC。不同語言的接口共享相同的基礎邏輯。 WCDB的代碼結構如下圖所示:
在這樣的體系結構下,不同語言的WCDB可以具有相同的接口結構和接口功能。在一個項目中,您可以用一個WCDB編寫不同語言的數據庫代碼。不同語言的數據庫邏輯不會衝突。某些全局接口(例如錯誤監視)可以同時使用不同語言的數據庫邏輯來工作。
以下Wikies包含有關WCDB建造和安裝的詳細說明。
可以在下面找到不同語言的教程:
如果您有興趣做出貢獻,請查看[貢獻。
開發者:深圳市騰訊計算機系統有限公司
WCDB個人信息保護規則