mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-18 15:27:17 +01:00
DatabaseConnection::database_connect() now returns Error.
This commit is contained in:
parent
06e0be8d04
commit
add7fff92b
@ -36,7 +36,8 @@
|
||||
#include "query_result.h"
|
||||
#include "table_builder.h"
|
||||
|
||||
void DatabaseConnection::database_connect(const String &connection_str) {
|
||||
Error DatabaseConnection::database_connect(const String &connection_str) {
|
||||
return ERR_PRINTER_ON_FIRE;
|
||||
}
|
||||
|
||||
Ref<QueryResult> DatabaseConnection::query(const String &query) {
|
||||
|
@ -45,7 +45,7 @@ class DatabaseConnection : public Reference {
|
||||
GDCLASS(DatabaseConnection, Reference);
|
||||
|
||||
public:
|
||||
virtual void database_connect(const String &connection_str);
|
||||
virtual Error database_connect(const String &connection_str);
|
||||
virtual Ref<QueryResult> query(const String &query);
|
||||
virtual void query_run(const String &query);
|
||||
|
||||
|
@ -26,7 +26,7 @@ Ref<TableBuilder> SQLite3DatabaseConnection::get_table_builder() {
|
||||
return b;
|
||||
}
|
||||
|
||||
void SQLite3DatabaseConnection::database_connect(const String &connection_str) {
|
||||
Error SQLite3DatabaseConnection::database_connect(const String &connection_str) {
|
||||
int ret = sqlite3_config(SQLITE_CONFIG_SERIALIZED);
|
||||
//if (ret != SQLITE_OK) {
|
||||
//ERR_PRINT("SQLITE3 multithreading is not supported!\n");
|
||||
@ -39,7 +39,10 @@ void SQLite3DatabaseConnection::database_connect(const String &connection_str) {
|
||||
|
||||
if (ret != SQLITE_OK) {
|
||||
ERR_PRINT(vformat("SQLITE3 database_connect failed! code: %d !", ret));
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Ref<QueryResult> SQLite3DatabaseConnection::query(const String &query) {
|
||||
|
@ -13,7 +13,7 @@ struct sqlite3;
|
||||
|
||||
class SQLite3DatabaseConnection : public DatabaseConnection {
|
||||
public:
|
||||
void database_connect(const String &connection_str);
|
||||
Error database_connect(const String &connection_str);
|
||||
Ref<QueryResult> query(const String &query);
|
||||
void query_run(const String &query);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user