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