|
ORM C++
|
Public Member Functions | |
| template<db::ConnectionConfiguration Config> | |
| Database (const Config &config, db::CommandGeneratorFactory registry={}) | |
| Constructs a new Database object. | |
| ~Database () noexcept | |
| Database (const Database &)=delete | |
| Database (Database &&)=delete | |
| auto | operator= (const Database &) -> Database &=delete |
| auto | operator= (Database &&) -> Database &=delete |
| template<db::ConnectionConfiguration Config> | |
| auto | connect (const Config &config) -> void |
| Connects to a database. | |
| auto | disconnect () -> void |
| Disconnects from the database. | |
| template<typename SchemaType> | |
| auto | orm () &noexcept -> OrmContext< SchemaType > |
| template<typename SchemaType> | |
| auto | orm () &&-> OrmContext< SchemaType >=delete |
| auto | getBackendType () const noexcept -> db::BackendType |
| Get the backend type of the database. | |
| auto | isConnected () const noexcept -> bool |
| Returns whether a backend session is currently open. | |
| auto | getBackendCapabilities () const -> const db::BackendCapabilities & |
| Returns the capabilities advertised by the connected backend. | |
| auto | scopedTransaction () &-> ScopedTransaction |
| auto | beginTransaction () -> void |
| Starts a transaction. | |
| auto | commitTransaction () -> void |
| Commits a transaction. | |
| auto | rollbackTransaction () -> void |
| Rollbacks a transaction. | |
Friends | |
| class | ScopedTransaction |
| template<typename> | |
| class | OrmContext |
Definition at line 47 of file connection.cppm.
|
inlineexplicit |
Constructs a new Database object.
Definition at line 54 of file connection.cppm.
|
noexcept |
|
delete |
|
delete |
| auto orm::Database::beginTransaction | ( | ) | -> void |
Starts a transaction.
| auto orm::Database::commitTransaction | ( | ) | -> void |
Commits a transaction.
|
inline |
Connects to a database.
| config | The typed connection parameters, borrowed during opening. |
Definition at line 70 of file connection.cppm.
| auto orm::Database::disconnect | ( | ) | -> void |
Disconnects from the database.
|
nodiscard |
Returns the capabilities advertised by the connected backend.
| DatabaseError | when no backend is connected. |
|
nodiscardnoexcept |
Get the backend type of the database.
|
nodiscardnoexcept |
Returns whether a backend session is currently open.
|
delete |
|
inlinenodiscardnoexcept |
Creates a borrowed ORM context. This Database must outlive the context.
Definition at line 82 of file connection.cppm.
| auto orm::Database::rollbackTransaction | ( | ) | -> void |
Rollbacks a transaction.
|
nodiscard |
Starts a transaction that rolls back on scope exit unless explicitly finished.
|
friend |
Definition at line 132 of file connection.cppm.
|
friend |
Definition at line 129 of file connection.cppm.