Go to the source code of this file.
◆ ORBIT_REGISTER_MODEL
| #define ORBIT_REGISTER_MODEL |
( |
|
Type, |
|
|
|
TableName |
|
) |
| |
Value: template <typename DBClient> \
inline ::orbit::orm::QueryBuilder<DBClient, Type> query_##Type(std::shared_ptr<DBClient> db) { \
return ::orbit::orm::QueryBuilder<DBClient, Type>(db, TableName); \
}
Registers a standard C++ struct as an ORM Model mapping to a database table.
Must be used in the global namespace after defining the struct and its NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE macro.
- Parameters
-
| Type | The C++ struct/class name. |
| TableName | The database table name as a string. |
◆ ORBIT_REGISTER_MODEL_WITH_KEY
| #define ORBIT_REGISTER_MODEL_WITH_KEY |
( |
|
Type, |
|
|
|
TableName, |
|
|
|
KeyColumn |
|
) |
| |
Value: template <typename DBClient> \
inline ::orbit::orm::QueryBuilder<DBClient, Type> query_##Type(std::shared_ptr<DBClient> db) { \
q.primary_key(KeyColumn); \
return q; \
}
A lightweight, JSON-backed ORM Query Builder with bound parameters.
Definition QueryBuilder.hpp:453
Registers a standard C++ struct as an ORM Model mapping to a MongoDB Collection.
- Parameters
-
| Type | The C++ struct/class name. Like ORBIT_REGISTER_MODEL, for a model whose primary key column is not "id". |
◆ ORBIT_REGISTER_MONGO_MODEL
| #define ORBIT_REGISTER_MONGO_MODEL |
( |
|
Type | ) |
|
Value: inline ::orbit::orm::MongoQueryBuilder<Type> query_mongo_##Type(std::shared_ptr<::orbit::database::MongoClient> db) { \
return ::orbit::orm::MongoQueryBuilder<Type>(db); \
}