The (documented) SQL Functions

file sql_sources.hh

Functions

void deleteIsa(void *IN_EntityID_INT_UNSIGNED)
void insert_single_child_version(void *in_EntityID_INT_UNSIGNED, void *in_Hash_VARBINARY, void *in_Version_VARBINARY, void *in_Parent_VARBINARY, void *in_Transaction_VARBINARY)

Creates a new version record in the entity_version table.

Parameters

EntityID The ID of the versioned entity. Hash A hash of the entity. This is currently not implemented properly and only there for future use. Version The new version ID of the entity, must be produced by the caller. Must be unique for each EntityID. Parent The version ID of the primary parent (i.e. predecessor). May be NULL; but if given, it must exist. Transaction The transaction ID which created this entity version (by inserting or updating an entity).

void delete_all_entity_versions(void *in_EntityID_INT_UNSIGNED)

Remove all records in the entity_version table for the given entity.

Parameters

EntityID The id of the versioned entity.

void get_iversion(void *EntityID_INT_UNSIGNED, void *Version_VARBINARY)

Get the internal version id (an integer) of the (API-)version id.

Parameters

EntityID The entity’s id. Version The (official, externally used) version id.

Returns

The internal version id.

void get_primary_parent_version(void *EntityID_INT_UNSIGNED, void *Version_VARBINARY)

Get the version ID of the primary parent (i.e. predecessor) of a version.

Parameters

EntityID The entity id. Version The version id.

Returns

The id of the given version’s primary parent version.

void get_version_timestamp(void *EntityID_INT_UNSIGNED, void *Version_VARBINARY)

Get the timestamp of a version by retrieving the timestamp of the transaction which created the version.

Parameters

EntityID The entity id. Version The version id.

Returns

The versions’ timestamp in <seconds-since-epoch>.<nanoseconds> format. Note that the dot . here is not necessarily a decimal separator.

void get_head_version(void *EntityID_INT_UNSIGNED)

Get the version id of the HEAD of an entity.

Parameters

EntityID The entity id.

Returns

The version id of the HEAD.

void _get_head_iversion(void *EntityID_INT_UNSIGNED)

Get the _iversion number of the HEAD of an entity.

Parameters

EntityID The entity id.

Returns

The _iversion of the HEAD.

void get_head_relative(void *EntityID_INT_UNSIGNED, void *Offset_INT_UNSIGNED)

Get the id of a version which is specified relative to the HEAD of an entity.

Parameters

EntityID The entity id. Offset Distance in the sequence of primary parents of the entity. E.g. 0 is the HEAD itself. 1 is the primary parent of the HEAD. 2 is the primary parent of the primary parent of the HEAD, and so on.

Returns

The version id of the HEAD.

void _get_version(void *EntityID_INT_UNSIGNED, void *IVersion_INT_UNSIGNED)

The inverse function of get_iversion. Resolves the version id.

Parameters

EntityID The entity id. IVersion Internal version id (integer).

Returns

The version id.

void get_version_history(void *in_EntityID_INT_UNSIGNED)

Select the complete transaction history of an entity (Who created which version and when).

Parameters

EntityID The entity id.

Selects

Tuples (child, parent, child_seconds, child_nanos, child_username, child_realm). child and parent are version IDs.

void retrieveQueryTemplateDef(void *in_EntityID_INT_UNSIGNED, void *in_Version_VARBINARY)

Select a query string from the templates tables.

Parameters

EntityID The QueryTemplate’s id. Version The QueryTemplate’s version’s id.

Returns

Tuple (definition). A CQL query string (-fragment) which defines this QueryTemplate.

void insertEntity(void *in_EntityName_VARCHAR, void *in_EntityDesc_TEXT, void *in_EntityRole_VARCHAR, void *in_ACL_VARBINARY)
void retrieveEntityParents(void *in_EntityID_INT_UNSIGNED, void *in_Version_VARBINARY)
void updateEntity(void *in_EntityID_INT_UNSIGNED, void *in_EntityName_VARCHAR, void *in_EntityDescription_TEXT, void *in_EntityRole_VARCHAR, void *in_Datatype_VARCHAR, void *in_Collection_VARCHAR, void *in_ACL_VARBINARY)
void insertIsa(void *IN_c_INT_UNSIGNED, void *IN_p_INT_UNSIGNED)

Insert an “is a” relation

This procedure fills the isa_cache table. All passed entities must be existing in entities.id.

Parameters

c : UNSIGNED The child entity

p : UNSIGNED The parent entity

dir _generated
page index

Global functions