2022-06-30 13:23:48 +02:00
|
|
|
#ifndef SQLITE3_TABLE_BUILDER_H
|
|
|
|
#define SQLITE3_TABLE_BUILDER_H
|
|
|
|
|
2022-07-06 22:14:37 +02:00
|
|
|
#include "core/ustring.h"
|
2022-06-30 13:23:48 +02:00
|
|
|
|
2022-07-06 22:14:37 +02:00
|
|
|
#include "../database/table_builder.h"
|
2022-06-30 13:23:48 +02:00
|
|
|
|
2022-07-06 22:14:37 +02:00
|
|
|
class SQLite3DatabaseConnection;
|
2022-06-30 13:23:48 +02:00
|
|
|
|
|
|
|
class SQLite3TableBuilder : public TableBuilder {
|
2022-07-06 22:14:37 +02:00
|
|
|
GDCLASS(SQLite3TableBuilder, TableBuilder);
|
2022-06-30 13:23:48 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
TableBuilder *create_table(const String &name);
|
|
|
|
|
2022-07-06 22:14:37 +02:00
|
|
|
TableBuilder *integer(const String &name, const int length = -1);
|
|
|
|
TableBuilder *tiny_integer(const String &name, const int length = -1);
|
|
|
|
TableBuilder *small_integer(const String &name, const int length = -1);
|
|
|
|
TableBuilder *real_float(const String &name, const int size = -1, const int d = -1);
|
|
|
|
TableBuilder *real_double(const String &name, const int size = -1, const int d = -1);
|
2022-06-30 13:23:48 +02:00
|
|
|
|
|
|
|
TableBuilder *date(const String &name);
|
|
|
|
|
2022-07-06 22:14:37 +02:00
|
|
|
TableBuilder *varchar(const String &name, const int length = -1);
|
2022-06-30 13:23:48 +02:00
|
|
|
TableBuilder *text(const String &name);
|
|
|
|
|
|
|
|
TableBuilder *not_null();
|
|
|
|
TableBuilder *null();
|
|
|
|
TableBuilder *defval(const String &val);
|
|
|
|
TableBuilder *auto_increment();
|
2022-07-06 22:14:37 +02:00
|
|
|
TableBuilder *primary_key(const String &name = "");
|
2022-06-30 13:23:48 +02:00
|
|
|
TableBuilder *primary_key();
|
|
|
|
TableBuilder *next_row();
|
|
|
|
TableBuilder *ccreate_table();
|
|
|
|
|
|
|
|
TableBuilder *drop_table();
|
|
|
|
TableBuilder *drop_table_if_exists();
|
2022-07-06 22:14:37 +02:00
|
|
|
TableBuilder *drop_table(const String &name = "");
|
2022-06-30 13:23:48 +02:00
|
|
|
TableBuilder *drop_table_if_exists(const String &name);
|
|
|
|
TableBuilder *cdrop_table();
|
|
|
|
|
|
|
|
TableBuilder *foreign_key(const String &name);
|
|
|
|
TableBuilder *references(const String &table, const String &name);
|
|
|
|
|
2022-07-06 22:14:37 +02:00
|
|
|
Ref<QueryResult> run();
|
|
|
|
void run_query();
|
2022-06-30 13:23:48 +02:00
|
|
|
|
|
|
|
SQLite3TableBuilder();
|
2022-07-06 22:14:37 +02:00
|
|
|
~SQLite3TableBuilder();
|
2022-06-30 13:23:48 +02:00
|
|
|
|
2022-07-06 22:14:37 +02:00
|
|
|
Ref<SQLite3DatabaseConnection> _connection;
|
2022-06-30 13:23:48 +02:00
|
|
|
};
|
|
|
|
|
2022-07-06 22:14:37 +02:00
|
|
|
#endif
|