diff --git a/examples/tom/main.cpp b/examples/tom/main.cpp index f891f0ec1..013e3cc3a 100644 --- a/examples/tom/main.cpp +++ b/examples/tom/main.cpp @@ -70,6 +70,7 @@ std::shared_ptr setupDatabaseManager() // Ownership of the shared_ptr() return DB::create({ +#if !PROJECT_TINYDRIVERS || TINYDRIVERS_MYSQL_DRIVER // MySQL connection {QStringLiteral("tinyorm_tom_mysql"), { // shell:connection {driver_, QMYSQL}, @@ -120,7 +121,8 @@ std::shared_ptr setupDatabaseManager() {Version, {}}, // Autodetect {options_, ConfigUtils::mariaSslOptions()}, }}, - +#endif +#if !PROJECT_TINYDRIVERS || TINYDRIVERS_PSQL_DRIVER // PostgreSQL connection {QStringLiteral("tinyorm_tom_postgres"), { // shell:connection {driver_, QPSQL}, @@ -154,7 +156,8 @@ std::shared_ptr setupDatabaseManager() // {dont_drop, QStringList {spatial_ref_sys}}, {options_, ConfigUtils::postgresSslOptions()}, }}, - +#endif +#if !PROJECT_TINYDRIVERS || TINYDRIVERS_SQLITE_DRIVER // SQLite connection {QStringLiteral("tinyorm_tom_sqlite"), { // shell:connection {driver_, QSQLITE}, @@ -171,6 +174,7 @@ std::shared_ptr setupDatabaseManager() {prefix_, EMPTY}, {prefix_indexes, false}, }} +#endif }, // MySQL as the default database connection QStringLiteral("tinyorm_tom_mysql")); diff --git a/tests/testdata_tom/main.cpp b/tests/testdata_tom/main.cpp index f72c02c60..4f96f3b07 100644 --- a/tests/testdata_tom/main.cpp +++ b/tests/testdata_tom/main.cpp @@ -86,6 +86,7 @@ std::shared_ptr setupDatabaseManager() // Ownership of the shared_ptr() return DB::create({ +#if !PROJECT_TINYDRIVERS || TINYDRIVERS_MYSQL_DRIVER // MySQL connection {sl("tinyorm_testdata_tom_mysql"), { // shell:connection {driver_, QMYSQL}, @@ -135,7 +136,8 @@ std::shared_ptr setupDatabaseManager() {Version, {}}, // Autodetect {options_, ConfigUtils::mariaSslOptions()}, }}, - +#endif +#if !PROJECT_TINYDRIVERS || TINYDRIVERS_PSQL_DRIVER // PostgreSQL connection {sl("tinyorm_testdata_tom_postgres"), { // shell:connection {driver_, QPSQL}, @@ -160,7 +162,8 @@ std::shared_ptr setupDatabaseManager() // {dont_drop, QStringList {spatial_ref_sys}}, {options_, ConfigUtils::postgresSslOptions()}, }}, - +#endif +#if !PROJECT_TINYDRIVERS || TINYDRIVERS_SQLITE_DRIVER // SQLite connection {sl("tinyorm_testdata_tom_sqlite"), { // shell:connection {driver_, QSQLITE}, @@ -177,6 +180,7 @@ std::shared_ptr setupDatabaseManager() {prefix_, EMPTY}, {prefix_indexes, false}, }} +#endif }, /* Because the default connection name is not defined, then will be needed to provide the connection name using the --database=xyz argument. */