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"]:
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"):
continue
tmppath = "./" + x
@ -216,8 +216,8 @@ if env_base["databases"]:
import detect
if detect.is_active() and detect.can_build():
x = x.replace("database/", "") # rest of world
x = x.replace("database\\", "") # win32
x = x.replace("database_modules/", "") # rest of world
x = x.replace("database_modules\\", "") # win32
database_list += [x]
sys.path.remove(tmppath)
@ -278,7 +278,7 @@ SConscript("web/SCsub")
SConscript("platform/SCsub")
if env_base["databases"]:
#add db folder
SConscript("database/SCsub")
for d in database_list:
tmppath = "./database_modules/" + d

View File

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

View File

@ -1,10 +1,10 @@
#include "db_settings.h"
#include "core/database/database.h"
#include "core/database/database_manager.h"
#include "core/database/query_builder.h"
#include "core/database/query_result.h"
#include "core/database/table_builder.h"
#include "database/database.h"
#include "database/database_manager.h"
#include "database/query_builder.h"
#include "database/query_result.h"
#include "database/table_builder.h"
void DBSettings::set_value(const String &key, const Variant &value) {
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 "core/database/database_manager.h"
#include "database/database_manager.h"
#include "mysql_query_builder.h"
#include "mysql_query_result.h"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
#ifndef 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
//later this will be fixed better

View File

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

View File

@ -1,7 +1,7 @@
#ifndef 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
//later this will be fixed better

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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