Loading src/database.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -184,11 +184,9 @@ void dbpp::ReplicatedDatabase::addReplica(const std::string &dbdriver, const std bool dbpp::ReplicatedDatabase::isWriteStatement(const char *sql) { if (!sql) return false; // Skip leading whitespace while (*sql == ' ' || *sql == '\t' || *sql == '\n' || *sql == '\r') ++sql; // Case-insensitive prefix check for write statements auto startsWith = [](const char *s, const char *prefix) -> bool { while (*prefix) { if (std::tolower((unsigned char)*s) != std::tolower((unsigned char)*prefix)) Loading @@ -208,7 +206,6 @@ bool dbpp::ReplicatedDatabase::isWriteStatement(const char *sql) { int dbpp::ReplicatedDatabase::exec(const SQL &sql, DBResult &res) const { if (isWriteStatement(sql.c_str())) { // Write: execute on primary first, then replicate to all replicas int rows = _primary->exec(sql, res); for (const auto &replica : _replicas) { Loading @@ -222,7 +219,6 @@ int dbpp::ReplicatedDatabase::exec(const SQL &sql, DBResult &res) const { return rows; } else { // Read: only from primary return _primary->exec(sql, res); } } Loading Loading
src/database.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -184,11 +184,9 @@ void dbpp::ReplicatedDatabase::addReplica(const std::string &dbdriver, const std bool dbpp::ReplicatedDatabase::isWriteStatement(const char *sql) { if (!sql) return false; // Skip leading whitespace while (*sql == ' ' || *sql == '\t' || *sql == '\n' || *sql == '\r') ++sql; // Case-insensitive prefix check for write statements auto startsWith = [](const char *s, const char *prefix) -> bool { while (*prefix) { if (std::tolower((unsigned char)*s) != std::tolower((unsigned char)*prefix)) Loading @@ -208,7 +206,6 @@ bool dbpp::ReplicatedDatabase::isWriteStatement(const char *sql) { int dbpp::ReplicatedDatabase::exec(const SQL &sql, DBResult &res) const { if (isWriteStatement(sql.c_str())) { // Write: execute on primary first, then replicate to all replicas int rows = _primary->exec(sql, res); for (const auto &replica : _replicas) { Loading @@ -222,7 +219,6 @@ int dbpp::ReplicatedDatabase::exec(const SQL &sql, DBResult &res) const { return rows; } else { // Read: only from primary return _primary->exec(sql, res); } } Loading