|
libcmdbm 0.2.0
MyBatis-like SQL mapping library for C99
|
The root object: the datasources of an application and the sessions which use them. More...
Data Fields | |
| CMBool(* | AddDatabase )(CMDBM_Context *context, CMDBM_Database *database) |
| Start a datasource and take it over. | |
| CMDBM_Session *(* | GetSession )(CMDBM_Context *context) |
| Open a session on this context. | |
| void(* | Destroy )(CMDBM_Context *context) |
| Destroy the context and every datasource in it. | |
The root object: the datasources of an application and the sessions which use them.
| CMBool(* CMDBM_Context::AddDatabase) (CMDBM_Context *context, CMDBM_Database *database) |
Start a datasource and take it over.
This is where a datasource comes to life: the module is initialized, the initial connections are opened, the mapper files are read and the reload task is scheduled.
| context | The context. |
| database | The datasource, built by CMDBM_DatabaseCreate. On success the context owns it and destroys it with itself; on failure it stays the caller's, to be destroyed through CMDBM_Database::Destroy. |
| CMDBM_Session *(* CMDBM_Context::GetSession) (CMDBM_Context *context) |
Open a session on this context.
Cheap: no connection is borrowed until a statement runs. Sessions are not shared between threads, and each is closed through CMDBM_Session::Close.
| context | The context. |
| void(* CMDBM_Context::Destroy) (CMDBM_Context *context) |
Destroy the context and every datasource in it.
Close the sessions first: a session outliving its context holds connections of pools which no longer exist.
| context | The context. |