1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-08-19 15:39:46 +00:00

Add column 'type' to sets and take its value on command line.

This commit is contained in:
King_DuckZ 2015-11-11 20:06:14 +00:00
parent 585c7f45b7
commit 911da3bb00
9 changed files with 78 additions and 25 deletions

View file

@ -125,9 +125,13 @@ namespace pq {
}
std::string Connection::escaped_literal (const std::string& parString) {
return this->escaped_literal(boost::string_ref(parString));
}
std::string Connection::escaped_literal (boost::string_ref parString) {
typedef std::unique_ptr<char[], void(*)(void*)> PQArrayType;
PQArrayType clean_str(PQescapeLiteral(m_localData->connection, parString.c_str(), parString.size()), &PQfreemem);
PQArrayType clean_str(PQescapeLiteral(m_localData->connection, parString.data(), parString.size()), &PQfreemem);
return std::string(clean_str.get());
}
} //namespace pq

View file

@ -22,6 +22,7 @@
#include <string>
#include <cstdint>
#include <memory>
#include <boost/utility/string_ref.hpp>
namespace pq {
class Connection {
@ -37,6 +38,7 @@ namespace pq {
ResultSet query ( const std::string& parQuery );
std::string escaped_literal ( const std::string& parString );
std::string escaped_literal ( boost::string_ref parString );
private:
struct LocalData;