#pragma once

#include <memory>

#include <sqlpp11/postgresql/postgresql.h>

namespace eedb::db {
class PgConfig;

class PgConnection {
  public:
    PgConnection(std::shared_ptr< eedb::db::PgConfig > config);

    sqlpp::postgresql::connection * native() {
        return _conn.get();
    }

	template < typename T >
    auto operator()(T && t) {
        return _conn->operator()(std::forward< T >(t));
    }

  private:
    std::unique_ptr< sqlpp::postgresql::connection > _conn;
};
}
