qicosmos / ormpp

modern C++ ORM, C++17, support mysql, postgresql,sqlite
Apache License 2.0
1.2k stars 260 forks source link

请教关于query的条件查询的用法 #153

Closed YlbIce closed 3 months ago

YlbIce commented 3 months ago

//查询数据,包括单表查询和多表查询 template<typename T, typename... Args> auto query(Args&&... args);

struct T_Test { int id; int addr; std::string name; } auto query(t, "id=1");是查询id=1的数据,如果要查询id=1 AND addr=2的数据时 auto query(t, "???");条件应该是以什么格式传入呢?

第二个问题是,创建表时,如果要是用id和addr两个字段共同作为key,ormpp_key key=???;应该如何设置?

多谢。

Jacyking commented 3 months ago

image image