|
libcmdbm 0.2.0
MyBatis-like SQL mapping library for C99
|
Data Structures | |
| struct | CMDBM_Context |
| The root object: the datasources of an application and the sessions which use them. More... | |
Functions | |
| CMDBM_Context * | CMDBM_ContextCreate (const char *confjson, const char *progcharset, CMUTIL_Timer *timer) |
| Create a context, optionally from a configuration file. | |
sessions.
| CMDBM_Context * CMDBM_ContextCreate | ( | const char * | confjson, |
| const char * | progcharset, | ||
| CMUTIL_Timer * | timer | ||
| ) |
Create a context, optionally from a configuration file.
With a configuration file this is the only call an application needs: the datasources declared in it are created, started and ready to be used through a session when it returns. Without one the context comes up empty, to be filled with CMDBM_DatabaseCreate and CMDBM_Context::AddDatabase.
| confjson | Path of the JSON configuration file, or NULL for an empty context. A file which cannot be read leaves the context empty as well; one which parses but is not valid configuration fails the call. |
| progcharset | The character set the application works in, "UTF-8" when NULL. Results are converted to it. |
| timer | The timer to schedule the mapper reload tasks and the pool maintenance on, or NULL to have the context keep one of its own. A timer passed in is not destroyed with the context, and must outlive it. |