change db lib to take credential reference instead

This commit is contained in:
Fabian Posch 2024-01-09 20:39:53 -05:00
parent 4d6a723d0b
commit 8855664d65
2 changed files with 4 additions and 4 deletions

View file

@ -44,12 +44,12 @@ class Connection {
public: public:
Connection( Connection(
db_credentials_t credentials, db_credentials_t& credentials,
std::function<void(pqxx::connection *c)> setup_function std::function<void(pqxx::connection *c)> setup_function
); );
Connection( Connection(
db_credentials_t credentials db_credentials_t& credentials
); );
~Connection(); ~Connection();

View file

@ -36,13 +36,13 @@ bool connected = false;
Connection::Connection( Connection::Connection(
db_credentials_t credentials, db_credentials_t& credentials,
std::function<void(pqxx::connection *c)> setup std::function<void(pqxx::connection *c)> setup
) : setup_function(move(setup)) { ) : setup_function(move(setup)) {
this->db_credentials = credentials; this->db_credentials = credentials;
} }
Connection::Connection(db_credentials_t credentials) { Connection::Connection(db_credentials_t& credentials) {
this->db_credentials = credentials; this->db_credentials = credentials;
} }