]> WPIA git - cassiopeia.git/blob - src/db/psql.h
fix: use correct prepared statement for writing logs
[cassiopeia.git] / src / db / psql.h
1 #pragma once
2
3 #include <string>
4 #include <memory>
5 #include <tuple>
6
7 #include "database.h"
8 #include <pqxx/pqxx>
9
10 class PostgresJobProvider : public JobProvider {
11 private:
12     pqxx::connection c;
13 public:
14     PostgresJobProvider( const std::string& server, const std::string& user, const std::string& password, const std::string& database );
15
16 public:
17     std::shared_ptr<Job> fetchJob();
18     void finishJob( std::shared_ptr<Job> job );
19     void failJob( std::shared_ptr<Job> job );
20     std::shared_ptr<TBSCertificate> fetchTBSCert( std::shared_ptr<Job> job );
21     void writeBack( std::shared_ptr<Job> job, std::shared_ptr<SignedCertificate> res );
22     std::pair<std::string, std::string> getRevocationInfo( std::shared_ptr<Job> job );
23     void writeBackRevocation( std::shared_ptr<Job> job, std::string date );
24 };