Mercurial > hg > orthanc-databases
comparison Framework/PostgreSQL/PostgreSQLDatabase.h @ 255:d663d9e44f8d
reintroduction of IDatabaseFactory into DatabaseManager
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 14 Apr 2021 17:57:08 +0200 |
parents | 35598014f140 |
children | cc7af42d4f23 |
comparison
equal
deleted
inserted
replaced
254:8a4ce70f456a | 255:d663d9e44f8d |
---|---|
24 #if ORTHANC_ENABLE_POSTGRESQL != 1 | 24 #if ORTHANC_ENABLE_POSTGRESQL != 1 |
25 # error PostgreSQL support must be enabled to use this file | 25 # error PostgreSQL support must be enabled to use this file |
26 #endif | 26 #endif |
27 | 27 |
28 #include "PostgreSQLParameters.h" | 28 #include "PostgreSQLParameters.h" |
29 #include "../Common/IDatabase.h" | 29 #include "../Common/IDatabaseFactory.h" |
30 | 30 |
31 namespace OrthancDatabases | 31 namespace OrthancDatabases |
32 { | 32 { |
33 class PostgreSQLDatabase : public IDatabase | 33 class PostgreSQLDatabase : public IDatabase |
34 { | 34 { |
35 private: | 35 private: |
36 friend class PostgreSQLStatement; | 36 friend class PostgreSQLStatement; |
37 friend class PostgreSQLLargeObject; | 37 friend class PostgreSQLLargeObject; |
38 | |
39 class Factory; | |
38 | 40 |
39 PostgreSQLParameters parameters_; | 41 PostgreSQLParameters parameters_; |
40 void* pg_; /* Object of type "PGconn*" */ | 42 void* pg_; /* Object of type "PGconn*" */ |
41 | 43 |
42 void ThrowException(bool log); | 44 void ThrowException(bool log); |
88 int32_t lock); | 90 int32_t lock); |
89 | 91 |
90 ~TransientAdvisoryLock(); | 92 ~TransientAdvisoryLock(); |
91 }; | 93 }; |
92 | 94 |
93 static PostgreSQLDatabase* OpenDatabaseConnection(const PostgreSQLParameters& parameters); | 95 static IDatabaseFactory* CreateDatabaseFactory(const PostgreSQLParameters& parameters); |
96 | |
97 static PostgreSQLDatabase* CreateDatabaseConnection(const PostgreSQLParameters& parameters); | |
94 }; | 98 }; |
95 } | 99 } |