set sqlite3 as default backend

This commit is contained in:
HanzZ 2012-04-08 13:53:14 +02:00
parent 9e6da7ea85
commit b326bca552
2 changed files with 9 additions and 1 deletions

View file

@ -44,6 +44,7 @@ message Login {
required string user = 1;
required string legacyName = 2;
required string password = 3;
repeated string extraFields = 4;
}
message Logout {
@ -122,6 +123,10 @@ message FileTransferData {
required bytes data = 2;
}
message BackendConfig {
required string config = 1;
}
message WrapperMessage {
enum Type {
TYPE_CONNECTED = 1;
@ -152,6 +157,7 @@ message WrapperMessage {
TYPE_FT_PAUSE = 27;
TYPE_FT_CONTINUE = 28;
TYPE_EXIT = 29;
TYPE_BACKEND_CONFIG = 30;
}
required Type type = 1;
optional bytes payload = 2;

View file

@ -10,7 +10,8 @@ namespace Transport {
StorageBackend *StorageBackend::createBackend(Config *config, std::string &error) {
StorageBackend *storageBackend = NULL;
#ifdef WITH_SQLITE
if (CONFIG_STRING(config, "database.type") == "sqlite3") {
if (CONFIG_STRING(config, "database.type") == "sqlite3" ||
(CONFIG_STRING(config, "database.type") == "none" && CONFIG_BOOL(config, "service.server_mode"))) {
storageBackend = new SQLite3Backend(config);
}
#else
@ -43,6 +44,7 @@ StorageBackend *StorageBackend::createBackend(Config *config, std::string &error
&& CONFIG_STRING(config, "database.type") != "pqxx" && CONFIG_STRING(config, "database.type") != "none") {
error = "Unknown storage backend " + CONFIG_STRING(config, "database.type");
}
return storageBackend;
}