4#include "Stroika/Frameworks/StroikaPreComp.h"
8#include "Stroika/Foundation/Database/SQL/ODBC.h"
13#include "ComputerNetwork.h"
14#include "DirectEmployeesDB.h"
15#include "ORMEmployeesDB.h"
16#include "ThreadTest.h"
22int main ([[maybe_unused]]
int argc, [[maybe_unused]]
const char* argv[])
24 using namespace Stroika::Foundation::Database::SQL;
26 using namespace Stroika::Samples::SQL;
29#if qStroika_HasComponent_sqlite
30 auto connectionFactory = [=] () {
32 return SQLite::Connection::New (SQLite::Connection::Options{.fInMemoryDB = u
"direct-employees-test"});
34 DirectEmployeesDB (connectionFactory);
39#if qStroika_HasComponent_sqlite
41 (void)std::filesystem::remove (dbPath);
42 auto connectionFactory = [=] () {
44 return SQLite::Connection::New (SQLite::Connection::Options{.fDBPath = dbPath});
46 DirectEmployeesDB (connectionFactory);
50#if qStroika_HasComponent_ODBC
55 auto connectionFactory = [=] () {
return ODBC::Connection::New (ODBC::Connection::Options{
"some-dsn"}); };
61#if qStroika_HasComponent_sqlite
63 (void)std::filesystem::remove (dbPath);
64 auto connectionFactory = [=] () {
66 auto conn = SQLite::Connection::New (SQLite::Connection::Options{.fDBPath = dbPath, .fBusyTimeout = 1s});
67 Assert (Math::NearlyEquals (conn.busyTimeout ().As<
double> (), 1.0));
70 ThreadTest (connectionFactory);
76#if qStroika_HasComponent_sqlite
78 (void)std::filesystem::remove (dbPath);
79 auto connectionFactory = [=] () {
81 auto conn = SQLite::Connection::New (SQLite::Connection::Options{.fDBPath = dbPath, .fBusyTimeout = 1s});
82 Assert (Math::NearlyEquals (conn.busyTimeout ().As<
double> (), 1.0));
85 ORMEmployeesDB (connectionFactory);
90#if qStroika_HasComponent_sqlite
92 (void)std::filesystem::remove (dbPath);
93 auto connectionFactory = [=] () {
return SQLite::Connection::New (SQLite::Connection::Options{.fDBPath = dbPath}); };
94 ComputerNetworksModel (connectionFactory);
filesystem::path GetTemporary()