HDK
|
#include <UT_SQLORM.h>
Public Types | |
using | error_callback_t = UT_Function< void(const UT_StringHolder &, const UT_ErrorCode &)> |
Public Member Functions | |
UT_SqlOrm (const UT_StringHolder &db_path) | |
UT_SqlOrm () | |
virtual | ~UT_SqlOrm ()=default |
UT_NON_COPYABLE (UT_SqlOrm) | |
void | configure (const UT_StringHolder &db_path, error_callback_t &&clb=error_callback_t()) |
UT_SqlStatement | cursor () const |
const UT_SqlDatabase & | database () const |
UT_SqlDatabase & | database () |
UT_AutoSqlTransaction | transaction (UT_AutoSqlTransaction::commit_callback_t &&callback, bool savepoint=true) |
void | migrate (UT_ORMMigrationResult &result, bool collect_sql=false) |
void | close (UT_ErrorCode *ec=nullptr) |
template<typename T > | |
void | registerModelMeta () |
UT_ORMModelMeta * | registerModelMeta (const UT_SharedPtr< UT_ORMModelMeta > &meta) |
UT_SharedPtr< UT_ORMModelMeta > | lookupMeta (const UT_StringView &name) |
const UT_Array< UT_SharedPtr < UT_ORMModelMeta > > & | metas () const |
Protected Member Functions | |
UT_SqlDatabase & | getDatabase_ () |
void | error_ (const UT_StringHolder &error, const UT_ErrorCode &ec) |
UT_Array< std::pair < UT_SharedPtr < UT_ORMMigration >, bool > > | sortMigrations_ (const UT_Array< UT_SharedPtr< UT_ORMMigration >> &migrations, const UT_StringSet &applied_migrations, UT_ErrorCode &ec) |
void | recordMigration_ (const UT_ORMMigration &mig) |
void | collectAppliedMigrations_ (UT_StringSet &applied_migrations, UT_StringHolder &message, UT_ErrorCode &ec) |
void | createMigrationTableIfNotExist_ (UT_StringHolder &message, UT_ErrorCode &ec) |
Static Protected Member Functions | |
static UT_UniquePtr < UT_IORMOperation > | createOperation (const UT_StringRef &type) |
Friends | |
class | UT_SqlOrmTable |
Definition at line 299 of file UT_SQLORM.h.
using UT_SqlOrm::error_callback_t = UT_Function<void(const UT_StringHolder&, const UT_ErrorCode&)> |
Definition at line 303 of file UT_SQLORM.h.
|
explicit |
UT_SqlOrm::UT_SqlOrm | ( | ) |
|
virtualdefault |
void UT_SqlOrm::close | ( | UT_ErrorCode * | ec = nullptr | ) |
|
protected |
void UT_SqlOrm::configure | ( | const UT_StringHolder & | db_path, |
error_callback_t && | clb = error_callback_t() |
||
) |
|
protected |
|
staticprotected |
|
inline |
Definition at line 314 of file UT_SQLORM.h.
|
inline |
Definition at line 318 of file UT_SQLORM.h.
|
inline |
Definition at line 322 of file UT_SQLORM.h.
|
protected |
|
protected |
|
inline |
Definition at line 378 of file UT_SQLORM.h.
|
inline |
Definition at line 388 of file UT_SQLORM.h.
void UT_SqlOrm::migrate | ( | UT_ORMMigrationResult & | result, |
bool | collect_sql = false |
||
) |
|
protected |
|
inline |
Definition at line 343 of file UT_SQLORM.h.
|
inline |
Definition at line 363 of file UT_SQLORM.h.
|
protected |
|
inline |
Definition at line 327 of file UT_SQLORM.h.
UT_SqlOrm::UT_NON_COPYABLE | ( | UT_SqlOrm | ) |
|
friend |
Definition at line 394 of file UT_SQLORM.h.
|
protected |
Definition at line 425 of file UT_SQLORM.h.
|
protected |
Definition at line 418 of file UT_SQLORM.h.
|
protected |
Definition at line 419 of file UT_SQLORM.h.
|
protected |
Definition at line 422 of file UT_SQLORM.h.
|
protected |
Definition at line 421 of file UT_SQLORM.h.
|
protected |
Definition at line 417 of file UT_SQLORM.h.
|
protected |
Definition at line 427 of file UT_SQLORM.h.