treedb_open_db()
#
treedb_open_db()
initializes and opens a tree database within a tranger
instance, using the specified schema and options.
Prototype
json_t *treedb_open_db(
json_t *tranger,
const char *treedb_name,
json_t *jn_schema, // owned
const char *options // "persistent"
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A reference to the |
|
|
The name of the tree database to open. |
|
|
A JSON object defining the schema of the tree database. This parameter is owned by the function. |
|
|
A string specifying options for opening the database, such as |
Return Value
A JSON dictionary representing the opened tree database inside tranger
. The returned object must not be used directly by the caller.
Notes
Ensure that tranger
is already initialized before calling treedb_open_db()
.
The function follows a hierarchical structure where nodes are linked via parent-child relationships.
If the persistent
option is enabled, the schema is loaded from a file, and modifications require a version update.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples