mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-11 13:21:10 +01:00
Added table version getters and setters to the DatabaseConnection.
This commit is contained in:
parent
0cac8406ec
commit
eb4875de4c
@ -33,6 +33,21 @@ Ref<Database> DatabaseConnection::get_owner() {
|
||||
return Ref<Database>(_owner);
|
||||
}
|
||||
|
||||
int DatabaseConnection::get_table_version(const String &table) {
|
||||
ensure_version_table_exists();
|
||||
|
||||
//get_query_builder()
|
||||
//TODO
|
||||
|
||||
return 0;
|
||||
}
|
||||
void DatabaseConnection::set_table_version(const String &table, const int version) {
|
||||
//TODO
|
||||
}
|
||||
void DatabaseConnection::ensure_version_table_exists() {
|
||||
//TODO
|
||||
}
|
||||
|
||||
void DatabaseConnection::set_owner(Database *owner) {
|
||||
_owner = owner;
|
||||
}
|
||||
@ -49,8 +64,15 @@ void DatabaseConnection::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("database_connect", "connection_str"), &DatabaseConnection::database_connect);
|
||||
ClassDB::bind_method(D_METHOD("query", "query"), &DatabaseConnection::query);
|
||||
ClassDB::bind_method(D_METHOD("query_run", "query"), &DatabaseConnection::query_run);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_query_builder"), &DatabaseConnection::get_query_builder);
|
||||
ClassDB::bind_method(D_METHOD("get_table_builder"), &DatabaseConnection::get_table_builder);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("escape", "str"), &DatabaseConnection::escape);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_table_version", "table"), &DatabaseConnection::get_table_version);
|
||||
ClassDB::bind_method(D_METHOD("set_table_version", "table", "version"), &DatabaseConnection::set_table_version);
|
||||
ClassDB::bind_method(D_METHOD("ensure_version_table_exists"), &DatabaseConnection::ensure_version_table_exists);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_owner"), &DatabaseConnection::get_owner);
|
||||
}
|
||||
|
@ -24,6 +24,10 @@ public:
|
||||
virtual String escape(const String &str);
|
||||
virtual void escape_to(const String &str, String *to);
|
||||
|
||||
virtual int get_table_version(const String &table);
|
||||
virtual void set_table_version(const String &table, const int version);
|
||||
virtual void ensure_version_table_exists();
|
||||
|
||||
Ref<Database> get_owner();
|
||||
void set_owner(Database *owner);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user