fixed PostgreSQL tests
This commit is contained in:
@@ -252,9 +252,10 @@ utils::result<std::vector<object::attribute>, utils::error> postgres_connection:
|
||||
}
|
||||
|
||||
utils::result<bool, utils::error> postgres_connection::exists(const std::string &schema_name, const std::string &table_name) {
|
||||
const std::string stmt(
|
||||
"SELECT 1 FROM information_schema.tables WHERE table_schema = '" + schema_name + "' AND table_name = '" + table_name
|
||||
+ "'");
|
||||
std::string stmt( "SELECT 1 FROM information_schema.tables WHERE table_name = '" + table_name + "'");
|
||||
if (!schema_name.empty()) {
|
||||
stmt += " AND table_schema = '" + schema_name + "'";
|
||||
}
|
||||
|
||||
PGresult *res = PQexec(conn_, stmt.c_str());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user