2021-08-19 22:24:16 +02:00
|
|
|
#ifndef SQLITE3_TABLE_BUILDER_H
|
|
|
|
#define SQLITE3_TABLE_BUILDER_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "core/database/table_builder.h"
|
|
|
|
|
2021-08-19 23:55:16 +02:00
|
|
|
class SQLite3Database;
|
|
|
|
|
2021-08-19 22:24:16 +02:00
|
|
|
class SQLite3TableBuilder : public TableBuilder {
|
|
|
|
public:
|
|
|
|
TableBuilder *create_table(const std::string &name);
|
|
|
|
TableBuilder *integer(const std::string &name);
|
|
|
|
TableBuilder *date(const std::string &name);
|
|
|
|
TableBuilder *varchar(const std::string &name, const int length);
|
|
|
|
TableBuilder *not_null();
|
|
|
|
TableBuilder *null();
|
|
|
|
TableBuilder *auto_increment();
|
|
|
|
TableBuilder *primary_key(const std::string &name);
|
|
|
|
TableBuilder *primary_key();
|
|
|
|
TableBuilder *next_row();
|
2021-08-19 23:55:16 +02:00
|
|
|
TableBuilder *ccreate_table();
|
2021-08-19 22:24:16 +02:00
|
|
|
|
2021-08-19 23:55:16 +02:00
|
|
|
TableBuilder *drop_table();
|
|
|
|
TableBuilder *drop_table_if_exists();
|
2021-08-19 22:24:16 +02:00
|
|
|
TableBuilder *drop_table(const std::string &name);
|
2021-08-19 23:55:16 +02:00
|
|
|
TableBuilder *drop_table_if_exists(const std::string &name);
|
|
|
|
TableBuilder *cdrop_table();
|
|
|
|
|
|
|
|
TableBuilder *foreign_key(const std::string &name);
|
|
|
|
TableBuilder *references(const std::string &table, const std::string &name);
|
2021-08-19 22:24:16 +02:00
|
|
|
|
2021-08-19 23:55:16 +02:00
|
|
|
virtual QueryResult *run();
|
|
|
|
virtual void run_query();
|
2021-08-19 22:24:16 +02:00
|
|
|
|
|
|
|
SQLite3TableBuilder();
|
|
|
|
virtual ~SQLite3TableBuilder();
|
2021-08-19 23:55:16 +02:00
|
|
|
|
|
|
|
SQLite3Database *_db;
|
2021-08-19 22:24:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|