lintel 0.2.0
Loading...
Searching...
No Matches
ScopedConnection.h
Go to the documentation of this file.
1#ifndef LINTEL_SCOPEDCONNECTION_H
2#define LINTEL_SCOPEDCONNECTION_H
3
4#include <memory>
5#include <string>
6
11
12namespace lintel {
13namespace db {
26 {
27 public:
28 explicit ScopedConnection(std::shared_ptr<DatabaseConnectionEntry> connectionEntry);
30
35
37
38 [[nodiscard]] bool valid() const;
39 [[nodiscard]] bool isPooled() const;
40
41 private:
42 void reset();
43
44 std::shared_ptr<DatabaseConnectionEntry> m_connectionEntry;
45 bool m_isPooled = false;
47 std::unique_ptr<Connection> m_directConnection;
48 };
49}// namespace db
50
51}// namespace lintel
52#endif// LINTEL_SCOPEDCONNECTION_H
Definition ConnectionPool.h:82
Definition Connection.h:25
Definition ScopedConnection.h:26
Connection & connection() const
ScopedConnection & operator=(const ScopedConnection &)=delete
ScopedConnection & operator=(ScopedConnection &&other) noexcept
ScopedConnection(std::shared_ptr< DatabaseConnectionEntry > connectionEntry)
ScopedConnection(ScopedConnection &&other) noexcept
ScopedConnection(const ScopedConnection &)=delete
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9