added session to work.cpp
This commit is contained in:
parent
d4253ee4d0
commit
7fd11ad174
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -89,11 +89,16 @@ int main() {
|
|||
.and_then([&schema] { return schema.attach<jobs::IdListPayload, jobs::Payload>("id_payloads"); })
|
||||
.and_then([&schema] { return schema.attach<jobs::Task>("tasks"); });
|
||||
|
||||
if (!result.is_ok()) {
|
||||
if (!result) {
|
||||
std::cout << "error: " << result.err().message() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
sql::connection_pool<sql::connection> 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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue