Tables
There are only two important tables in Smereka – the Nodes and Attributes. Two tables are used for caching pages (see "Fir") and another one – for the organization of external redirects.
Nodes
The table includes the following fields:
id – 4-byte unsigned integer. It is primary key of the table.
parent – 4-byte unsigned integer. It is the link to parent node of this node.
seqpos – 4-byte unsigned integer. Specifies the sequence of nodes with the same hierarchical position (sibling nodes).
class – 4-byte unsigned integer. Specifies the class of the node, is actually a link to the metaclass node for this node. See part Node classes.
accesslevel – 1-byte unsigned integer. Specifies the access level of the node. See section Access rights.
link – 4-byte unsigned integer. Link to other node in the tree, default 0 – ie no link.
zone – 4-byte unsigned integer. Determine the administration zone of the node. See section Access rights.
symbname – string of variable length, up to 32 characters. Contains the symbolic name of the node used for computing its URL.
lastupdate – date of last modification of the node.
Within Smereka nodes form a tree, organized by field parent and seqpos. The tree in the simplest case is shown directly as the site document tree. For example, if the root site node is example.com and it has a subordinate node Shop, and the latter – child node Mercedes, then to buy a Mercedes you need to enter example.com/Shop/Mercedes.html.
Attributes (attrs)
Smereka stores all the attributes in one table. The table includes the following fields:
id – 4-byte unsigned integer. It is primary key of the table.
nodeid – 4-byte unsigned integer. Link to the node, which is owner of the attribute. It must contain values of some of the primary key of the Nodes table.
name – string of variable length, up to 32 characters. Indicates the internal name of the attribute. Smereka uses this name to identify the attribute, but as a name on a web page usually does not appear.
datatype – 1-byte integer that specifies the data type attribute. Valid values:
1 – integer (with sign)
2 – integer (unsigned)
3 – link to the node
4 – string
5 – text (up to 16 MB)
6 – the calendar date (and time)
7 – file (including images)
8 – a real number (floating point)
lang – the 2-characters field, which determines the language version of the attribute; language-independent attributes contain NULL.
dwvalue – 4-byte unsigned integer (double word). Usage defined data type attribute:
2 – integer (unsigned) – attribute value;
3 – a link to another node in the Smereka tree. Therefore, valid values are 0 or the ID of any existing node. This allows you to monitor the integrity of links. When the node s removed instantly, all pointers to it are also deleted too.
dblvalue – 8-byte floating point number. Used for attributes of type "real number".
datevalue – 8-byte date field. Used for attributes such as "calendar date".
strvalue – string of variable length to 512 characters. Usage defined data type attribute:
4 – string – attribute value;
7 – file (including images) – list of the file attributes in the format name="value", separated by spaces. See more "File attributes".
txtvalue – text field (up to 16 megabytes), which is the value an attribute of type "text".
File attributes
Attribute of type "file" – an example of the structural attribute whose value is not just a number or string, but a collection of primitive data types. The attributes describe the external files, including images. But they do not contain the file data – they are stored as separate files in the server OS. Smereka retains all the elements of file attributes as single string.
fname – string that contains the file name. If the file can not be cached, fname contains the full path and file name on the server. If the file is only cached on the server, and constantly kept in another place (repository), then fname contains the full path and file name in the repository. On the server cached file is placed in a certain fixed location.
cacheable – Logical field that allows the cache file. By default – false, the file is not cached.