From 7fd11ad1741285c0bfe448c40fbbbee3081d0e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20K=C3=BChl?= Date: Tue, 8 Jul 2025 14:15:45 +0200 Subject: [PATCH] added session to work.cpp --- demo/CMakeLists.txt | 4 +++- demo/work.cpp | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 9be198b..d2439cf 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -19,5 +19,7 @@ target_link_libraries(work PRIVATE matador-core matador-orm ${CMAKE_DL_LIBS} - ${SQLite3_LIBRARIES} + ${PostgreSQL_LIBRARY} ) + +add_dependencies(work matador-postgres) diff --git a/demo/work.cpp b/demo/work.cpp index 0326e42..6ac2560 100644 --- a/demo/work.cpp +++ b/demo/work.cpp @@ -89,11 +89,16 @@ int main() { .and_then([&schema] { return schema.attach("id_payloads"); }) .and_then([&schema] { return schema.attach("tasks"); }); - if (!result.is_ok()) { + if (!result) { std::cout << "error: " << result.err().message() << std::endl; return 0; } + sql::connection_pool pool("postgres://test:test123!@127.0.0.1:15432/postgres", 4); + + orm::session ses(pool); + + result = ses.create_schema(); schema.dump(std::cout); // const std::string dns{"sqlite://demo.db"}; // sql::connection c(dns);