rcpp_framework/core/database/table_builder.h

63 lines
1.9 KiB
C
Raw Normal View History

#ifndef TABLE_BUILDER_H
#define TABLE_BUILDER_H
#include "core/string.h"
#include "core/reference.h"
2021-08-19 23:55:16 +02:00
class QueryResult;
class TableBuilder : public Reference {
public:
virtual TableBuilder *create_table(const String &name);
virtual TableBuilder *integer(const String &name);
virtual TableBuilder *integer(const String &name, const int length);
virtual TableBuilder *tiny_integer(const String &name);
virtual TableBuilder *tiny_integer(const String &name, const int length);
virtual TableBuilder *small_integer(const String &name);
virtual TableBuilder *small_integer(const String &name, const int length);
virtual TableBuilder *real_float(const String &name);
virtual TableBuilder *real_float(const String &name, const int size, const int d);
virtual TableBuilder *real_double(const String &name);
virtual TableBuilder *real_double(const String &name, const int size, const int d);
virtual TableBuilder *date(const String &name);
2021-11-20 01:39:52 +01:00
virtual TableBuilder *varchar(const String &name, const int length);
2021-11-20 01:39:52 +01:00
virtual TableBuilder *text(const String &name);
virtual TableBuilder *not_null();
virtual TableBuilder *null();
virtual TableBuilder *defval(const String &val);
virtual TableBuilder *auto_increment();
virtual TableBuilder *primary_key(const String &name);
virtual TableBuilder *primary_key();
virtual TableBuilder *next_row();
2021-08-19 23:55:16 +02:00
virtual TableBuilder *ccreate_table();
2021-08-19 23:55:16 +02:00
virtual TableBuilder *drop_table();
virtual TableBuilder *drop_table_if_exists();
virtual TableBuilder *drop_table(const String &name);
virtual TableBuilder *drop_table_if_exists(const String &name);
2021-08-19 23:55:16 +02:00
virtual TableBuilder *cdrop_table();
virtual TableBuilder *foreign_key(const String &name);
virtual TableBuilder *references(const String &table, const String &name);
2021-08-19 23:55:16 +02:00
virtual Ref<QueryResult> run();
2021-08-19 23:55:16 +02:00
virtual void run_query();
2021-08-19 23:55:16 +02:00
void print();
TableBuilder();
virtual ~TableBuilder();
String result;
};
#endif