-- today constant are the variable of the future
CREATE TABLE IF NOT EXISTS constant (
    name TEXT NOT NULL,
    val INTEGER NOT NULL
);
DELETE FROM constant;
INSERT INTO constant VALUES('common.sql',1);
INSERT INTO constant VALUES('animation duration',300);
INSERT INTO constant VALUES('screen width',40);
INSERT INTO constant VALUES('screen heigth',25);

-- very handy for generating table
CREATE VIEW IF NOT EXISTS enum16 AS
    SELECT 0 AS num
    UNION SELECT 1
    UNION SELECT 2
    UNION SELECT 3
    UNION SELECT 4
    UNION SELECT 5
    UNION SELECT 6
    UNION SELECT 7
    UNION SELECT 8
    UNION SELECT 9
    UNION SELECT 10
    UNION SELECT 11
    UNION SELECT 12
    UNION SELECT 13
    UNION SELECT 14
    UNION SELECT 15;


CREATE VIEW IF NOT EXISTS enumUTF7 AS
    SELECT (high.num*16)+low.num AS num
    FROM enum16 AS high, enum16 AS low
    WHERE high.num>1
    AND high.num<8;

CREATE VIEW IF NOT EXISTS enum256 AS
    SELECT (high.num*16)+low.num AS num
    FROM enum16 AS high, enum16 AS low;

CREATE VIEW IF NOT EXISTS rightnow AS
    SELECT STRFTIME('%f', 'NOW') AS second,
           STRFTIME('%m', 'NOW') AS minute; 
