name mode size
dbtex 040000
Makefile 100644 230B
Readme 100644 1.41kB
dbt_api.c 100644 8.13kB
dbt_api.h 100644 1.87kB
dbt_base.c 100644 10.88kB
dbt_file.c 100644 12.2kB
dbt_lib.c 100644 8.98kB
dbt_lib.h 100644 3.54kB
dbt_res.c 100644 11.33kB
dbt_res.h 100644 2.29kB
dbt_tb.c 100644 8.69kB
dbt_util.c 100644 1.47kB
dbt_util.h 100644 1.22kB
dbtext.c 100644 2.59kB
dbtext.h 100644 2.2kB
DBTEXT module ------------- The module implements a simplified database engine based on text files. It can be used by DB interface of SER instead of other database modules (like MySQL). The module has no parameters or exported methods for usage in SER's scripts. Design of engine ---------------- - a database is represented by a directory - a table is represented by a text file from db directory Internal format of table ------------------------ - first line is the definition of the columns * the name of column must not include white spaces * the format of column description: "name(type,attr)" * the type of columns can be 'int', 'double' or 'str' (strings with size less than 4KB) * a column can have one of the attributes > null - accept null values in a field of that column > auto - only for 'int' columns, the value is auto-incremented if is not provided a value in queries > if no attribute is set, the fields of the column cannot have null value - each other line is a row with data - each field is separated by ':' - no value between two ':' (or between ':' and start/end of row) means null value - next characters must be escaped in strings: '\n', '\r', '\t', ':' - 0 -- the zero value must be escaped too Sample of a table ----------------- -> id(int,auto) name(str) flag(double) desc(str,null) 1:nick:0.34:a\tgood\: friend 2:cole:-3.75:colleague 3:lina:2.50: <-