The (documented) SQL Functions

file sql_sources.hh

Functions

void retrieveOverrides(void *in_DomainID_VARCHAR, void *in_EntityID_VARCHAR, void *in_Version_VARBINARY)
void isSubtype(void *in_ChildID_VARCHAR, void *in_ParentID_VARCHAR)
void overrideName(void *in_InternalDomainID_INT_UNSIGNED, void *in_InternalEntityID_INT_UNSIGNED, void *in_InternalPropertyID_INT_UNSIGNED, void *in_Name_VARCHAR)
void overrideDesc(void *in_InternalDomainID_INT_UNSIGNED, void *in_InternalEntityID_INT_UNSIGNED, void *in_InternalPropertyID_INT_UNSIGNED, void *in_Description_TEXT)
void overrideType(void *in_InternalDomainID_INT_UNSIGNED, void *in_InternalEntityID_INT_UNSIGNED, void *in_InternalPropertyID_INT_UNSIGNED, void *in_InternalDataTypeID_INT_UNSIGNED)
void insertEntityDataType(void *in_PropertyID_VARCHAR, void *in_DataTypeID_VARCHAR)
void insertEntityCollection(void *in_PropertyID_VARCHAR, void *in_Collection_VARCHAR)
void deleteIsa(void *IN_InternalEntityID_INT_UNSIGNED)
void insert_single_child_version(void *in_InternalEntityID_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

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

void get_iversion(void *InternalEntityID_INT_UNSIGNED, void *Version_VARBINARY)

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

Parameters

InternalEntityID : INT UNSIGNED The entity’s internal id. Version : VARBINARY(255) The (official, externally used) version id.

Returns

The internal version id.

void get_primary_parent_version(void *EntityID_VARCHAR, void *Version_VARBINARY)

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

Parameters

EntityID : VARCHAR(255) The entity id. Version : VARBINARY(255) The version id.

Returns

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

void get_version_timestamp(void *EntityID_VARCHAR, void *Version_VARBINARY)

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

Parameters

EntityID : VARCHAR(255) The entity id. Version : VARBINARY(255) 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_VARCHAR)

Get the version id of the HEAD of an entity.

Parameters

EntityID : VARCHAR(255) The entity id.

Returns

The version id of the HEAD.

void _get_head_iversion(void *InternalEntityID_INT_UNSIGNED)

Get the _iversion number of the HEAD of an entity.

Parameters

InternalEntityID : INT UNSIGNED The entity’s internal id.

Returns

The _iversion of the HEAD.

void get_head_relative(void *EntityID_VARCHAR, void *Offset_INT_UNSIGNED)

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

Parameters

EntityID : VARCHAR(255) The entity id. Offset : INT UNSIGNED 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 *InternalEntityID_INT_UNSIGNED, void *IVersion_INT_UNSIGNED)

The inverse function of get_iversion. Resolves the version id.

Parameters

InternalEntityID : INT UNSIGNED The entity’s internal id. IVersion Internal version id (integer).

Returns

The (external) version id.

void get_version_history(void *in_EntityID_VARCHAR)

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

Parameters

EntityID : VARCHAR(255) 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_VARCHAR, void *in_Version_VARBINARY)

Select a query string from the templates tables.

Parameters

EntityID : VARCHAR(255) The QueryTemplate’s id. Version : VARBINARY(255) The QueryTemplate’s version’s id.

Returns

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

void getIdByName(void *in_Name_VARCHAR, void *in_Role_VARCHAR, void *in_Lmt_INT_UNSIGNED)
void deleteEntityProperties(void *in_EntityID_VARCHAR)
void insertEntity(void *in_EntityID_VARCHAR, void *in_EntityName_VARCHAR, void *in_EntityDesc_TEXT, void *in_EntityRole_VARCHAR, void *in_ACL_VARBINARY)
void retrieveEntityParents(void *in_EntityID_VARCHAR, void *in_Version_VARBINARY)
void updateEntity(void *in_EntityID_VARCHAR, void *in_EntityName_VARCHAR, void *in_EntityDescription_TEXT, void *in_EntityRole_VARCHAR, void *in_DatatypeID_VARCHAR, void *in_Collection_VARCHAR, void *in_ACL_VARBINARY)
void insertEntityProperty(void *in_DomainID_VARCHAR, void *in_EntityID_VARCHAR, void *in_PropertyID_VARCHAR, void *in_Datatable_VARCHAR, void *in_PropertyValue_TEXT, void *in_PropertyUnitSig_BIGINT, void *in_PropertyStatus_VARCHAR, void *in_NameOverride_VARCHAR, void *in_DescOverride_TEXT, void *in_DatatypeOverride_VARCHAR, void *in_Collection_VARCHAR, void *in_PropertyIndex_INT_UNSIGNED)
void getDependentEntities(void *in_EntityID_VARCHAR)
void insertIsa(void *IN_ChildID_VARCHAR, void *IN_ParentID_VARCHAR)

Insert an “is a” relation

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

Parameters

ChildID : VARCHAR(255) The child entity.

ParentID : VARCHAR(255) The parent entity.

dir _generated
page index

Global functions