mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-08-19 15:39:46 +00:00
Fix hashing and db insertion.
This commit is contained in:
parent
777b91b898
commit
4236b2ece8
7 changed files with 70 additions and 30 deletions
|
@ -123,4 +123,11 @@ namespace pq {
|
|||
throw DatabaseException("Error running query", error_message(), __FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
std::string Connection::escape_literal (const std::string& parString) {
|
||||
typedef std::unique_ptr<char[], void(*)(void*)> PQArrayType;
|
||||
|
||||
PQArrayType clean_str(PQescapeLiteral(m_localData->connection, parString.c_str(), parString.size()), &PQfreemem);
|
||||
return std::string(clean_str.get());
|
||||
}
|
||||
} //namespace pq
|
||||
|
|
|
@ -36,6 +36,8 @@ namespace pq {
|
|||
void query_void ( const std::string& parQuery );
|
||||
ResultSet query ( const std::string& parQuery );
|
||||
|
||||
std::string escape_literal ( const std::string& parString );
|
||||
|
||||
private:
|
||||
struct LocalData;
|
||||
|
||||
|
@ -46,6 +48,7 @@ namespace pq {
|
|||
const uint16_t m_port;
|
||||
std::unique_ptr<LocalData> m_localData;
|
||||
};
|
||||
|
||||
} //namespace pq
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue