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个人信息保护规则