Independent Project.Database Structure

translations:

should I support multiple matchtypes for a single rule?

database commands:

note:

at some point, matches.function should probably be converted into an ID referencing the code in another table. This is not because functions will take up unnecessary space, but that this makes it far easier to implement a fast compiled caching system. This way the code can be stored by ID and looked up by ID which is very fast. The cache system would need some way to look them up and give them IDs anyway.

Now it looks like it shouldn't be too slow to process from SQL memory anyway. select m where matchtype='match were looking for', loop through these, test them, if they match, follow it.

It seems that at this point, it is assumed that this table will be read into memory by lua, where the organization of the tables fit nicely into a lookup on the matchtypes resulting in a list of rules whose rulematches can then be tested. If the rulematches match, then the rule data can be queried.

At this point it seems to make more sense to have a table mapping matchtypes to matches and their ruleid rather than having two seperate matchtypes and rulematches tables.


Process

create table process (expr varchar(16384), file varchar(4196), stdin blob, args varchar(4196));

lua function

create table lua (expr varchar(16384), lua_code text);

string

create table string (id int NOT NULL AUTO_INCREMENT, expr varchar(16384), result varchar(16384), context varchar(16384), exec integer, PRIMARY KEY(id));

create table string_commands (id int, command varchar(1024));

matching shortcuts

create table match_env (name char(255), expr varchar(16384));

translations

create table translations (expr varchar(16384), translation varchar(1024));