Browse Source

add db_safe util method

main
Stefan Pranger 3 years ago
parent
commit
ede7da0c94
  1. 2
      CMakeLists.txt
  2. 7
      db/db.cpp
  3. 4
      db/db.h

2
CMakeLists.txt

@ -20,7 +20,7 @@ add_executable(notification-daemon
db/create.h db/create.h
db/update.h db/update.h
db/Schema.cpp db/Schema.cpp
db/db.h
db/db.cpp
db/migrations/Migration.cpp db/migrations/Migration.cpp
db/migrations/builder/Table.cpp db/migrations/builder/Table.cpp
db/statements/builder/Statement.cpp db/statements/builder/Statement.cpp

7
db/db.cpp

@ -0,0 +1,7 @@
#include <db/db.h>
std::string db_safe(std::string str) {
str.insert(0, "\"");
str += "\"";
return str;
}

4
db/db.h

@ -1,5 +1,7 @@
#pragma once #pragma once
#include <string>
#include <SQLiteCpp.h> #include <SQLiteCpp.h>
#include <io/debug.h> #include <io/debug.h>
@ -16,3 +18,5 @@ namespace sql = SQLite;
namespace db_builder = db::migrations::builder; namespace db_builder = db::migrations::builder;
namespace stmt = db::statements::builder; namespace stmt = db::statements::builder;
std::string db_safe(std::string str);
Loading…
Cancel
Save