mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Now the database backends will actually compile their .cpp files. Also small cleanups.
This commit is contained in:
parent
d713aeab8e
commit
4add0d14ea
@ -133,6 +133,7 @@ env_base.Append(CXX=["-o3"])
|
||||
#env_base.Append(CXX=["-g2"])
|
||||
|
||||
env = env_base.Clone()
|
||||
Export("env")
|
||||
|
||||
for d in database_list:
|
||||
tmppath = "./database/" + d
|
||||
@ -188,11 +189,9 @@ for m in module_list:
|
||||
sys.path.remove(tmppath)
|
||||
sys.modules.pop("detect")
|
||||
|
||||
Export("env")
|
||||
|
||||
SConscript("core/SCsub")
|
||||
|
||||
env.prg_sources = ["rdn_application.cpp"]
|
||||
env.prg_sources = [ "rdn_application.cpp" ]
|
||||
libapp = env.add_library("application", env.prg_sources)
|
||||
env.Prepend(LIBS=[libapp])
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
Import("env_db")
|
||||
Import("env")
|
||||
|
||||
env_db.core_sources = []
|
||||
|
||||
@ -8,4 +9,4 @@ env_db.add_source_files(env_db.core_sources, "*.cpp")
|
||||
|
||||
# Build it all as a library
|
||||
lib = env_db.add_library("database_mysql", env_db.core_sources)
|
||||
env_db.Prepend(LIBS=[lib])
|
||||
env.Prepend(LIBS=[lib])
|
||||
|
@ -1 +1,15 @@
|
||||
#include "mysql_database.h"
|
||||
#include "mysql_database.h"
|
||||
|
||||
#include "core/database_manager.h"
|
||||
|
||||
Database *MysqlDatabase::_creation_func() {
|
||||
return new MysqlDatabase();
|
||||
}
|
||||
|
||||
void MysqlDatabase::_register() {
|
||||
DatabaseManager::_register_db_creation_func("mysql", MysqlDatabase::_creation_func);
|
||||
}
|
||||
|
||||
void MysqlDatabase::_unregister() {
|
||||
DatabaseManager::_unregister_db_creation_func("mysql");
|
||||
}
|
@ -2,7 +2,6 @@
|
||||
#define MYSQL_CONNECTION
|
||||
|
||||
#include "core/database.h"
|
||||
#include "core/database_manager.h"
|
||||
|
||||
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
||||
//later this will be fixed better
|
||||
@ -14,17 +13,9 @@
|
||||
|
||||
class MysqlDatabase : public Database {
|
||||
public:
|
||||
static Database *_creation_func() {
|
||||
return new MysqlDatabase();
|
||||
}
|
||||
|
||||
static void _register() {
|
||||
DatabaseManager::_register_db_creation_func("mysql", MysqlDatabase::_creation_func);
|
||||
}
|
||||
|
||||
static void _unregister() {
|
||||
DatabaseManager::_unregister_db_creation_func("mysql");
|
||||
}
|
||||
static Database *_creation_func();
|
||||
static void _register();
|
||||
static void _unregister();
|
||||
|
||||
MysqlDatabase() : Database() {
|
||||
mysql = new MYSQL();
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
Import("env_db")
|
||||
Import("env")
|
||||
|
||||
env_db.core_sources = []
|
||||
|
||||
@ -8,4 +9,4 @@ env_db.add_source_files(env_db.core_sources, "*.cpp")
|
||||
|
||||
# Build it all as a library
|
||||
lib = env_db.add_library("database_pgsql", env_db.core_sources)
|
||||
env_db.Prepend(LIBS=[lib])
|
||||
env.Prepend(LIBS=[lib])
|
||||
|
@ -1 +1,15 @@
|
||||
#include "pgsql_database.h"
|
||||
#include "pgsql_database.h"
|
||||
|
||||
#include "core/database_manager.h"
|
||||
|
||||
Database *PGSQLDatabase::_creation_func() {
|
||||
return new PGSQLDatabase();
|
||||
}
|
||||
|
||||
void PGSQLDatabase::_register() {
|
||||
DatabaseManager::_register_db_creation_func("pgsql", PGSQLDatabase::_creation_func);
|
||||
}
|
||||
|
||||
void PGSQLDatabase::_unregister() {
|
||||
DatabaseManager::_unregister_db_creation_func("pgsql");
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
#define PGSQL_CONNECTION
|
||||
|
||||
#include "core/database.h"
|
||||
#include "core/database_manager.h"
|
||||
|
||||
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
||||
//later this will be fixed better
|
||||
@ -14,19 +13,12 @@
|
||||
|
||||
class PGSQLDatabase : public Database {
|
||||
public:
|
||||
static Database *_creation_func() {
|
||||
return new PGSQLDatabase();
|
||||
}
|
||||
static Database *_creation_func();
|
||||
static void _register();
|
||||
static void _unregister();
|
||||
|
||||
static void _register() {
|
||||
DatabaseManager::_register_db_creation_func("pgsql", PGSQLDatabase::_creation_func);
|
||||
}
|
||||
|
||||
static void _unregister() {
|
||||
DatabaseManager::_unregister_db_creation_func("pgsql");
|
||||
}
|
||||
|
||||
PGSQLDatabase() : Database() {
|
||||
PGSQLDatabase() :
|
||||
Database() {
|
||||
conn = PQconnectStart("");
|
||||
}
|
||||
~PGSQLDatabase() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
Import("env_db")
|
||||
Import("env")
|
||||
|
||||
env_db.core_sources = []
|
||||
|
||||
@ -8,4 +9,4 @@ env_db.add_source_files(env_db.core_sources, "*.cpp")
|
||||
|
||||
# Build it all as a library
|
||||
lib = env_db.add_library("database_pgsql", env_db.core_sources)
|
||||
env_db.Prepend(LIBS=[lib])
|
||||
env.Prepend(LIBS=[lib])
|
||||
|
@ -1 +1,15 @@
|
||||
#include "sqlite3_database.h"
|
||||
#include "sqlite3_database.h"
|
||||
|
||||
#include "core/database_manager.h"
|
||||
|
||||
Database *SQLite3Database::_creation_func() {
|
||||
return new SQLite3Database();
|
||||
}
|
||||
|
||||
void SQLite3Database::_register() {
|
||||
DatabaseManager::_register_db_creation_func("sqlite", SQLite3Database::_creation_func);
|
||||
}
|
||||
|
||||
void SQLite3Database::_unregister() {
|
||||
DatabaseManager::_unregister_db_creation_func("sqlite");
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
#define SQLITE3_CONNECTION
|
||||
|
||||
#include "core/database.h"
|
||||
#include "core/database_manager.h"
|
||||
|
||||
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
||||
//later this will be fixed better
|
||||
@ -16,17 +15,9 @@
|
||||
|
||||
class SQLite3Database : public Database {
|
||||
public:
|
||||
static Database *_creation_func() {
|
||||
return new SQLite3Database();
|
||||
}
|
||||
|
||||
static void _register() {
|
||||
DatabaseManager::_register_db_creation_func("sqlite", SQLite3Database::_creation_func);
|
||||
}
|
||||
|
||||
static void _unregister() {
|
||||
DatabaseManager::_unregister_db_creation_func("sqlite");
|
||||
}
|
||||
static Database *_creation_func();
|
||||
static void _register();
|
||||
static void _unregister();
|
||||
|
||||
SQLite3Database() :
|
||||
Database() {
|
||||
|
Loading…
Reference in New Issue
Block a user