You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
738 B

  1. #include "UpdateStatementBuilder.h"
  2. namespace db {
  3. namespace statements {
  4. namespace builder {
  5. UpdateStatementBuilder &UpdateStatementBuilder::table(const std::string &table) {
  6. m_statement.body += "UPDATE " + table;
  7. return *this;
  8. }
  9. UpdateStatementBuilder &UpdateStatementBuilder::set(const std::string &set) {
  10. m_statement.body += " SET " + set + " ";
  11. return *this;
  12. }
  13. UpdateStatementBuilder &UpdateStatementBuilder::where(const std::string &where) {
  14. m_statement.body += " WHERE " + where;
  15. return *this;
  16. }
  17. UpdateStatementBuilder &UpdateStatementBuilder::close() {
  18. m_statement.body += ";\n";
  19. return *this;
  20. }
  21. }
  22. }
  23. }