rcpp_framework/database_backends/sqlite/sqlite3_table_builder.h

63 lines
1.7 KiB
C
Raw Normal View History

2021-08-19 22:24:16 +02:00
#ifndef SQLITE3_TABLE_BUILDER_H
#define SQLITE3_TABLE_BUILDER_H
#include "core/string.h"
2021-08-19 22:24:16 +02:00
#include "database/table_builder.h"
2021-08-19 22:24:16 +02:00
2021-08-19 23:55:16 +02:00
class SQLite3Database;
2021-08-19 22:24:16 +02:00
class SQLite3TableBuilder : public TableBuilder {
RCPP_OBJECT(SQLite3TableBuilder, TableBuilder);
2021-08-19 22:24:16 +02:00
public:
TableBuilder *create_table(const String &name);
TableBuilder *integer(const String &name);
TableBuilder *integer(const String &name, const int length);
TableBuilder *tiny_integer(const String &name);
TableBuilder *tiny_integer(const String &name, const int length);
TableBuilder *small_integer(const String &name);
TableBuilder *small_integer(const String &name, const int length);
TableBuilder *real_float(const String &name);
TableBuilder *real_float(const String &name, const int size, const int d);
TableBuilder *real_double(const String &name);
TableBuilder *real_double(const String &name, const int size, const int d);
TableBuilder *date(const String &name);
2021-11-20 01:39:52 +01:00
TableBuilder *varchar(const String &name, const int length);
2021-11-20 01:39:52 +01:00
TableBuilder *text(const String &name);
2021-08-19 22:24:16 +02:00
TableBuilder *not_null();
TableBuilder *null();
TableBuilder *defval(const String &val);
2021-08-19 22:24:16 +02:00
TableBuilder *auto_increment();
TableBuilder *primary_key(const String &name);
2021-08-19 22:24:16 +02:00
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();
TableBuilder *drop_table(const String &name);
TableBuilder *drop_table_if_exists(const String &name);
2021-08-19 23:55:16 +02:00
TableBuilder *cdrop_table();
TableBuilder *foreign_key(const String &name);
TableBuilder *references(const String &table, const String &name);
2021-08-19 22:24:16 +02:00
virtual Ref<QueryResult> run();
2021-08-19 23:55:16 +02:00
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