#include "work/admin/CollectionCenter.hpp" #include "work/admin/InternalUserDirectory.hpp" #include "work/admin/LdapGroupSchemaSettings.hpp" #include "work/admin/LdapImportSettings.hpp" #include "work/admin/LdapUserDirectory.hpp" #include "work/admin/LdapUserSchemaSettings.hpp" #include "work/admin/LoginHistory.hpp" #include "work/admin/Scenario.hpp" #include "work/admin/User.hpp" #include "work/admin/UserDirectory.hpp" #include "work/admin/UserSession.hpp" #include "work/jobs/Job.hpp" #include "work/jobs/Task.hpp"" #include "work/jobs/Payload.hpp" #include "work/jobs/IdPayload.hpp" #include "work/jobs/IdListPayload.hpp" #include "matador/object/schema.hpp" #include "matador/sql/connection.hpp" #include "matador/orm/session.hpp" using namespace matador; using namespace work::models; int main() { object::schema schema("Administration"); auto result = schema.attach("collection_center") .and_then([&schema] { return schema.attach("internal_user_directory"); }) .and_then([&schema] { return schema.attach("ldap_group_schema_settings"); }) .and_then([&schema] { return schema.attach("ldap_import_settings"); }) .and_then([&schema] { return schema.attach("ldap_user_directory"); } ) .and_then([&schema] { return schema.attach("ldap_user_schema_settings"); }) .and_then([&schema] { return schema.attach("login_history"); }) .and_then([&schema] { return schema.attach("scenario"); }) .and_then([&schema] { return schema.attach("user"); }) .and_then([&schema] { return schema.attach("user_directory"); }) .and_then([&schema] { return schema.attach("user_session"); }) .and_then([&schema] { return schema.attach("jobs"); }) .and_then([&schema] { return schema.attach("id_payloads"); }) .and_then([&schema] { return schema.attach("id_list_payloads"); }) .and_then([&schema] { return schema.attach("payloads"); }) .and_then([&schema] { return schema.attach("tasks"); }); if (!result.is_ok()) { return 0; } const std::string dns{"sqlite://demo.db"}; sql::connection c(dns); result = c.open(); // orm::session s() if (!result.is_ok()) { return 0; } return 0; } // registering table 'collection_center' (pk field: 'id') // registering relation table 'collection_center_users' (first fk field: 'collection_center_id', second fk field: 'user_id') // registering table 'internal_user_directory' (pk field: 'id') //