1 Star 11 Fork 1

Asciphx / ccORM

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
o2o.cc 796 Bytes
一键复制 编辑 原始数据 按行查看 历史
asciphx 提交于 2022-03-17 23:50 . QueryBuilder
#include "src/ccORM.hh"
auto D =
//D_mysql();
//D_pgsql();
D_sqlite("any.db");
#include "module.hh"
int main(int argc, char* argv[]) { //For example, if on() has multiple conditions, up to three conditions. eg : two conditions
//cout << ((Tab::$id == Type::$id) && (Type::$bigBlob == Tab::$name)) << '\n';//(`Tab`.`id`=`Type`.`id` AND `Type`.`bigBlob`=`Tab`.`name`)
Type u; Tab t = Tab::Q().innerJoin<Type>().where(Tab::$id == 2).GetOne(&u); cout << t << '\n';//default frist key = an other frist key
//Tab t = Tab::Q().leftJoin<Type>().GetOne();
vector<Type> vu; vector<Tab> vt = Tab::Q().innerJoin<Type>(Tab::$id == Type::$id).GetArr(&vu); cout << vt << '\n';
text<> c = Query<Tab>(Tab::$id).size(3).Get<text<>>(); cout << " IN" << c; // IN(1,2,3) Prepare splice clause
return 0;
}
C++
1
https://gitee.com/ASCIPHX/ccORM.git
git@gitee.com:ASCIPHX/ccORM.git
ASCIPHX
ccORM
ccORM
main

搜索帮助