msg2db_open_db()#
msg2db_open_db() initializes and opens a message database using TimeRanger, loading its schema and configuration. The function supports persistence by loading the schema from a file if the ‘persistent’ option is enabled.
Prototype
json_t *msg2db_open_db(
json_t *tranger,
const char *msg2db_name,
json_t *jn_schema, // owned
const char *options // "persistent"
);
Parameters
Key |
Type |
Description |
|---|---|---|
|
|
A reference to the TimeRanger instance managing the database. |
|
|
The name of the message database to open. |
|
|
A JSON object defining the schema of the database. Ownership is transferred to |
|
|
Optional settings, such as “persistent” to load the schema from a file. |
Return Value
A JSON object representing the opened message database, or NULL on failure.
Notes
The function tranger2_startup() must be called before invoking msg2db_open_db().
If the ‘persistent’ option is enabled, the schema is loaded from a file, which takes precedence over any provided schema.
To modify the schema after it has been saved, the schema version and topic version must be updated.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples