Retrieve the current version number of the database schema (dictionary).
MCO_RET mco_dict_version(
/*IN*/ mco_db_h db,
/*OUT*/ int *dict_version
);
db
dict_version
This function returns the internal version number of the database dictionary (schema).
The dictionary version can be used to:
- Detect schema changes between application runs,
- Implement schema-aware caching or validation logic,
- Coordinate upgrades in distributed or replicated environments.
Note: The version number is persistent across database sessions and is stored as part of the database metadata.
MCO_S_OK
MCO_E_INVALID_HANDLE
mco_db_h db;
int version;
MCO_RET rc;
rc = mco_db_connect("mydb", &db);
if (rc == MCO_S_OK) {
rc = mco_dict_version(db, &version);
if (rc == MCO_S_OK) {
printf("Current dictionary version: %d\n", version);
}
}