lintel 0.2.0
Loading...
Searching...
No Matches
Connection.h
Go to the documentation of this file.
1#ifndef LINTEL_CONNECTION_H
2#define LINTEL_CONNECTION_H
3
4#include <memory>
5
9
10namespace lintel {
11namespace db {
12
13 class Transaction;
14
15 class Statement;
16
17 class PreparedStatement;
18
19 class Notify;
20
25 {
26 private:
27 std::shared_ptr<postgresql::Connection> m_conn = nullptr;
28 std::shared_ptr<sqlite::Connection> m_connSQLite = nullptr;
29
30 ConnectionType m_connectionType;
31
32 friend class Transaction;
33
34 friend class Statement;
35
36 friend class PreparedStatement;
37
38 friend class Notify;
39
40 friend class Cursor;
41
42 public:
49
54 explicit Connection(const std::shared_ptr<DatabaseConnectionEntry> &connectionEntry);
55
56 explicit Connection(Connection &connection) = delete;
57
66 [[nodiscard]] bool isHealthy() const;
67 };
68}// namespace db
69
70}// namespace lintel
71#endif// LINTEL_CONNECTION_H
Definition ConnectionType.h:15
Definition Connection.h:25
bool isHealthy() const
Connection(ConnectionType connectionType, const std::string &connectionInfo)
Connection(Connection &connection)=delete
Connection(const std::shared_ptr< DatabaseConnectionEntry > &connectionEntry)
Definition Cursor.h:32
Definition Notify.h:17
Definition PreparedStatement.h:18
Definition Statement.h:17
Definition Transaction.h:14
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9