|
libcmdbm 0.2.0
MyBatis-like SQL mapping library for C99
|
A datasource: one database, its pool and its statements. More...
Data Fields | |
| CMBool(* | AddMapper )(CMDBM_Database *db, const char *mapperfile) |
| Load one mapper file into this datasource. | |
| CMBool(* | AddMapperSet )(CMDBM_Database *db, const char *basepath, const char *filepattern, CMBool recursive) |
| Load every mapper file matching a pattern. | |
| CMBool(* | SetMonitor )(CMDBM_Database *db, int interval) |
| How often the mapper files are checked for changes. | |
| void(* | Destroy )(CMDBM_Database *db) |
| Destroy the datasource, closing every connection it pooled. | |
A datasource: one database, its pool and its statements.
| CMBool(* CMDBM_Database::AddMapper) (CMDBM_Database *db, const char *mapperfile) |
Load one mapper file into this datasource.
The statements of the file become available under "namespace.statement". Loading a path which is already loaded replaces it, statement by statement - which is what the reload monitor uses when a file changes on disk.
| db | The datasource. |
| mapperfile | Path of the XML mapper file. |
| CMBool(* CMDBM_Database::AddMapperSet) (CMDBM_Database *db, const char *basepath, const char *filepattern, CMBool recursive) |
Load every mapper file matching a pattern.
The set is remembered as a whole, so the reload monitor notices files which appear, change or disappear under basepath afterwards.
| db | The datasource. |
| basepath | Directory to look in. |
| filepattern | Glob pattern the file names must match, "*.xml" being the usual one. |
| recursive | Whether subdirectories are searched too. |
| CMBool(* CMDBM_Database::SetMonitor) (CMDBM_Database *db, int interval) |
How often the mapper files are checked for changes.
Must be called before the datasource is handed to CMDBM_Context::AddDatabase, which is where the task is scheduled. Without it the interval is 30 seconds.
| db | The datasource. |
| interval | Seconds between two checks. |
| void(* CMDBM_Database::Destroy) (CMDBM_Database *db) |
Destroy the datasource, closing every connection it pooled.
Only for a datasource which was never added to a context, or whose CMDBM_Context::AddDatabase failed: a context destroys the datasources it took over.
| db | The datasource. |