diff --git a/modules/database/SCsub b/modules/database/SCsub index 43dfe2365..fa0fa50ef 100644 --- a/modules/database/SCsub +++ b/modules/database/SCsub @@ -7,6 +7,15 @@ module_env = env.Clone() sources = [ "register_types.cpp", + + "database.cpp", + "database_connection.cpp", + "database_manager.cpp", + "database_multi_threaded.cpp", + "database_single_threaded.cpp", + "query_builder.cpp", + "query_result.cpp", + "table_builder.cpp", ] if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': diff --git a/modules/database/config.py b/modules/database/config.py index 7ee6cced8..304781503 100644 --- a/modules/database/config.py +++ b/modules/database/config.py @@ -10,6 +10,14 @@ def configure(env): def get_doc_classes(): return [ #"", + "Database", + "DatabaseConnection", + "DatabaseManager", + "DatabaseMultiThreaded", + "DatabaseSingleThreaded", + "QueryBuilder", + "QueryResult", + "TableBuilder", ] def get_doc_path(): diff --git a/modules/database/database_connection.cpp b/modules/database/database_connection.cpp index ccff67fca..4b418ab47 100644 --- a/modules/database/database_connection.cpp +++ b/modules/database/database_connection.cpp @@ -33,6 +33,10 @@ Ref DatabaseConnection::get_owner() { return Ref(_owner); } +void DatabaseConnection::set_owner(Database *owner) { + _owner = owner; +} + DatabaseConnection::DatabaseConnection() { _owner = nullptr; } diff --git a/modules/database/database_manager.cpp b/modules/database/database_manager.cpp index a035d060f..655ac6d0e 100644 --- a/modules/database/database_manager.cpp +++ b/modules/database/database_manager.cpp @@ -1,11 +1,12 @@ #include "database_manager.h" +#include "database.h" + void DatabaseManager::load() { //go thourgh settings, and create all the defined db backends - //add them to ProjectSettings + //add them to ProjectSettings } - DatabaseManager *DatabaseManager::get_singleton() { return _instance; } @@ -19,4 +20,3 @@ DatabaseManager::~DatabaseManager() { } DatabaseManager *DatabaseManager::_instance = nullptr; - diff --git a/modules/database/query_builder.cpp b/modules/database/query_builder.cpp index 6f3db90fe..c0afca011 100644 --- a/modules/database/query_builder.cpp +++ b/modules/database/query_builder.cpp @@ -373,7 +373,7 @@ void QueryBuilder::_bind_methods() { ClassDB::bind_method(D_METHOD("select_last_insert_id"), &QueryBuilder::_select_last_insert_id_bind); - ClassDB::bind_method(D_METHOD("escape", "param"), &QueryBuilder::_escape_bind); + ClassDB::bind_method(D_METHOD("escape", "param"), &QueryBuilder::escape); ClassDB::bind_method(D_METHOD("prepare"), &QueryBuilder::_prepare_bind); ClassDB::bind_method(D_METHOD("set_params", "index", "value"), &QueryBuilder::_set_params_bind); @@ -575,10 +575,6 @@ Ref QueryBuilder::_select_last_insert_id_bind() { return Ref(select_last_insert_id()); } -Ref QueryBuilder::_escape_bind(const String ¶ms) { - return Ref(escape(params)); -} - Ref QueryBuilder::_prepare_bind() { return Ref(prepare()); } diff --git a/modules/database/query_builder.h b/modules/database/query_builder.h index 2bd6d6914..b210e5fb5 100644 --- a/modules/database/query_builder.h +++ b/modules/database/query_builder.h @@ -203,8 +203,6 @@ protected: Ref _select_last_insert_id_bind(); - Ref _escape_bind(const String ¶ms); - Ref _prepare_bind(); Ref _set_params_bind(const int index, const String &value); Ref _set_parami_bind(const int index, const int value); diff --git a/modules/database/register_types.cpp b/modules/database/register_types.cpp index 76bbce18d..7528774e2 100644 --- a/modules/database/register_types.cpp +++ b/modules/database/register_types.cpp @@ -22,8 +22,24 @@ SOFTWARE. #include "register_types.h" +#include "database.h" +#include "database_connection.h" +#include "database_manager.h" +#include "database_multi_threaded.h" +#include "database_single_threaded.h" +#include "query_builder.h" +#include "query_result.h" +#include "table_builder.h" + void register_database_types() { - //ClassDB::register_class<>(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); } void unregister_database_types() { diff --git a/modules/database/table_builder.cpp b/modules/database/table_builder.cpp index 7f83c34d4..8f1c06a15 100644 --- a/modules/database/table_builder.cpp +++ b/modules/database/table_builder.cpp @@ -34,6 +34,10 @@ TableBuilder *TableBuilder::real_double(const String &name, const int size, cons return this; } +TableBuilder *TableBuilder::date(const String &name) { + return this; +} + TableBuilder *TableBuilder::varchar(const String &name, const int length) { return this; }