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.

36 lines
849 B

  1. #pragma once
  2. #include <iostream>
  3. #include <string>
  4. #include <sstream>
  5. namespace db {
  6. namespace migrations {
  7. namespace builder {
  8. class TableBuilder;
  9. class CreateTableBuilder;
  10. class AlterTableBuilder;
  11. class DropTableBuilder;
  12. class Table {
  13. public:
  14. Table() = default;
  15. friend class CreateTableBuilder;
  16. friend class AlterTableBuilder;
  17. friend class DropTableBuilder;
  18. friend std::ostream &operator<<(std::ostream &os, const Table &t);
  19. static CreateTableBuilder create(const std::string table_name);
  20. static AlterTableBuilder alter(const std::string table_name);
  21. static DropTableBuilder drop(const std::string table_name);
  22. std::string str() const;
  23. private:
  24. std::string header;
  25. std::string body;
  26. };
  27. }
  28. }
  29. }