Moved core/databases to just datatbases. Also fox database module detection login.

This commit is contained in:
Relintai 2022-02-05 15:57:40 +01:00
parent 309208d359
commit 81780683a4
34 changed files with 62 additions and 51 deletions

View File

@ -207,7 +207,7 @@ database_list = []
if env_base["databases"]: if env_base["databases"]:
env_base.Append(CPPDEFINES=["DATABASES_ENABLED"]) env_base.Append(CPPDEFINES=["DATABASES_ENABLED"])
for x in sorted(glob.glob("database/*")): for x in sorted(glob.glob("database_modules/*")):
if not os.path.isdir(x) or not os.path.exists(x + "/detect.py"): if not os.path.isdir(x) or not os.path.exists(x + "/detect.py"):
continue continue
tmppath = "./" + x tmppath = "./" + x
@ -216,8 +216,8 @@ if env_base["databases"]:
import detect import detect
if detect.is_active() and detect.can_build(): if detect.is_active() and detect.can_build():
x = x.replace("database/", "") # rest of world x = x.replace("database_modules/", "") # rest of world
x = x.replace("database\\", "") # win32 x = x.replace("database_modules\\", "") # win32
database_list += [x] database_list += [x]
sys.path.remove(tmppath) sys.path.remove(tmppath)
@ -278,7 +278,7 @@ SConscript("web/SCsub")
SConscript("platform/SCsub") SConscript("platform/SCsub")
if env_base["databases"]: if env_base["databases"]:
#add db folder SConscript("database/SCsub")
for d in database_list: for d in database_list:
tmppath = "./database_modules/" + d tmppath = "./database_modules/" + d

View File

@ -1,6 +1,6 @@
#include "object.h" #include "object.h"
#include "core/database/database.h" #include "database/database.h"
Object::Object() { Object::Object() {
db = nullptr; db = nullptr;

View File

@ -1,10 +1,10 @@
#include "db_settings.h" #include "db_settings.h"
#include "core/database/database.h" #include "database/database.h"
#include "core/database/database_manager.h" #include "database/database_manager.h"
#include "core/database/query_builder.h" #include "database/query_builder.h"
#include "core/database/query_result.h" #include "database/query_result.h"
#include "core/database/table_builder.h" #include "database/table_builder.h"
void DBSettings::set_value(const String &key, const Variant &value) { void DBSettings::set_value(const String &key, const Variant &value) {
const Variant &v = _data[key]; const Variant &v = _data[key];

11
database/SCsub Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env python
Import("env")
env.core_sources = []
env.add_source_files(env.core_sources, "*.cpp")
# Build it all as a library
lib = env.add_library("database", env.core_sources)
env.Prepend(LIBS=[lib])

View File

@ -2,7 +2,7 @@
#include <cstdio> #include <cstdio>
#include "core/database/database_manager.h" #include "database/database_manager.h"
#include "mysql_query_builder.h" #include "mysql_query_builder.h"
#include "mysql_query_result.h" #include "mysql_query_result.h"

View File

@ -3,7 +3,7 @@
#include "core/string.h" #include "core/string.h"
#include "core/database/database.h" #include "database/database.h"
#include <memory> #include <memory>

View File

@ -4,7 +4,7 @@
#include <memory> #include <memory>
#include "core/string.h" #include "core/string.h"
#include "core/database/query_builder.h" #include "database/query_builder.h"
class MysqlDatabase; class MysqlDatabase;
class MysqlQueryResult; class MysqlQueryResult;

View File

@ -1,7 +1,7 @@
#ifndef MYSQL_QUERY_RESULT_H #ifndef MYSQL_QUERY_RESULT_H
#define MYSQL_QUERY_RESULT_H #define MYSQL_QUERY_RESULT_H
#include "core/database/query_result.h" #include "database/query_result.h"
#include <mysql.h> #include <mysql.h>

View File

@ -3,7 +3,7 @@
#include "core/string.h" #include "core/string.h"
#include "core/database/table_builder.h" #include "database/table_builder.h"
class MysqlTableBuilder : public TableBuilder { class MysqlTableBuilder : public TableBuilder {
RCPP_OBJECT(MysqlTableBuilder, TableBuilder); RCPP_OBJECT(MysqlTableBuilder, TableBuilder);

View File

@ -1,6 +1,6 @@
#include "pgsql_database.h" #include "pgsql_database.h"
#include "core/database/database_manager.h" #include "database/database_manager.h"
Database *PGSQLDatabase::_creation_func() { Database *PGSQLDatabase::_creation_func() {
return new PGSQLDatabase(); return new PGSQLDatabase();

View File

@ -1,7 +1,7 @@
#ifndef PGSQL_CONNECTION #ifndef PGSQL_CONNECTION
#define PGSQL_CONNECTION #define PGSQL_CONNECTION
#include "core/database/database.h" #include "database/database.h"
//Brynet has it aswell, and because of using namespace it is defined here aswell //Brynet has it aswell, and because of using namespace it is defined here aswell
//later this will be fixed better //later this will be fixed better

View File

@ -1,6 +1,6 @@
#include "sqlite3_database.h" #include "sqlite3_database.h"
#include "core/database/database_manager.h" #include "database/database_manager.h"
#include "sqlite3_query_builder.h" #include "sqlite3_query_builder.h"
#include "sqlite3_query_result.h" #include "sqlite3_query_result.h"

View File

@ -1,7 +1,7 @@
#ifndef SQLITE3_CONNECTION #ifndef SQLITE3_CONNECTION
#define SQLITE3_CONNECTION #define SQLITE3_CONNECTION
#include "core/database/database.h" #include "database/database.h"
//Brynet has it aswell, and because of using namespace it is defined here aswell //Brynet has it aswell, and because of using namespace it is defined here aswell
//later this will be fixed better //later this will be fixed better

View File

@ -4,7 +4,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "core/database/query_builder.h" #include "database/query_builder.h"
class SQLite3Database; class SQLite3Database;

View File

@ -4,7 +4,7 @@
#include "core/string.h" #include "core/string.h"
#include <vector> #include <vector>
#include "core/database/query_result.h" #include "database/query_result.h"
#include "./sqlite/sqlite3.h" #include "./sqlite/sqlite3.h"

View File

@ -1,6 +1,6 @@
#include "sqlite3_table_builder.h" #include "sqlite3_table_builder.h"
#include "core/database/query_result.h" #include "database/query_result.h"
#include "sqlite3_database.h" #include "sqlite3_database.h"

View File

@ -3,7 +3,7 @@
#include "core/string.h" #include "core/string.h"
#include "core/database/table_builder.h" #include "database/table_builder.h"
class SQLite3Database; class SQLite3Database;

View File

@ -4,10 +4,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include "core/database/database_manager.h" #include "database/database_manager.h"
#include "core/database/query_builder.h" #include "database/query_builder.h"
#include "core/database/query_result.h" #include "database/query_result.h"
#include "core/database/table_builder.h" #include "database/table_builder.h"
#include "core/hash/sha256.h" #include "core/hash/sha256.h"

View File

@ -8,11 +8,11 @@
#include "core/settings/settings.h" #include "core/settings/settings.h"
#ifdef DATABASES_ENABLED #ifdef DATABASES_ENABLED
#include "core/database/database.h" #include "database/database.h"
#include "core/database/database_manager.h" #include "database/database_manager.h"
#include "core/database/query_builder.h" #include "database/query_builder.h"
#include "core/database/query_result.h" #include "database/query_result.h"
#include "core/database/table_builder.h" #include "database/table_builder.h"
#endif #endif
String WebNode::get_uri_segment() { String WebNode::get_uri_segment() {

View File

@ -4,7 +4,7 @@
#include <iostream> #include <iostream>
#include "core/file_cache.h" #include "core/file_cache.h"
#include "core/database/database_manager.h" #include "database/database_manager.h"
#include "web/html/html_builder.h" #include "web/html/html_builder.h"
void StaticFolderPage::handle_request_main(Request *request) { void StaticFolderPage::handle_request_main(Request *request) {

View File

@ -1,10 +1,10 @@
#include "message_page.h" #include "message_page.h"
#include "core/database/database.h" #include "database/database.h"
#include "core/database/query_builder.h" #include "database/query_builder.h"
#include "core/database/table_builder.h" #include "database/table_builder.h"
#include "core/database/query_result.h" #include "database/query_result.h"
void MessagePage::handle_request_main(Request *request) { void MessagePage::handle_request_main(Request *request) {
Ref<QueryBuilder> b = db->get_query_builder(); Ref<QueryBuilder> b = db->get_query_builder();

View File

@ -11,11 +11,11 @@
#include "rbac_default_permissions.h" #include "rbac_default_permissions.h"
#include "web_modules/users/user.h" #include "web_modules/users/user.h"
#include "core/database/database.h" #include "database/database.h"
#include "core/database/database_manager.h" #include "database/database_manager.h"
#include "core/database/query_builder.h" #include "database/query_builder.h"
#include "core/database/query_result.h" #include "database/query_result.h"
#include "core/database/table_builder.h" #include "database/table_builder.h"
void RBACController::handle_request_main(Request *request) { void RBACController::handle_request_main(Request *request) {
} }

View File

@ -8,10 +8,10 @@
#include <tinydir/tinydir.h> #include <tinydir/tinydir.h>
#include <cstdio> #include <cstdio>
#include "core/database/database_manager.h" #include "database/database_manager.h"
#include "core/database/query_builder.h" #include "database/query_builder.h"
#include "core/database/query_result.h" #include "database/query_result.h"
#include "core/database/table_builder.h" #include "database/table_builder.h"
#include "web/html/form_validator.h" #include "web/html/form_validator.h"
#include "web/html/html_builder.h" #include "web/html/html_builder.h"

View File

@ -7,11 +7,11 @@
#include "web/http/request.h" #include "web/http/request.h"
#include "web/http/session_manager.h" #include "web/http/session_manager.h"
#include "core/database/database.h" #include "database/database.h"
#include "core/database/database_manager.h" #include "database/database_manager.h"
#include "core/database/query_builder.h" #include "database/query_builder.h"
#include "core/database/query_result.h" #include "database/query_result.h"
#include "core/database/table_builder.h" #include "database/table_builder.h"
#include "core/hash/sha256.h" #include "core/hash/sha256.h"