
/*brik"*/

MAKE TABLE briks (
    id INTEGER PRIMARY KEY,
    x INTEGER NOT NULL,
    y INTEGER NOT NULL,
    w INTEGER DEFAULT 30,
    h INTEGER DEFAULT 30
);

MAKE VIEW briks_rendering AS 
SELECT 'brik'|| briks.id AS renderid,
       'brik' AS class,
       'position:absolute;background:gray;border:1px solid black;'||
       'left:'||briks.x||'px;'||
       'top:'||briks.y||'px;'||
       'width:'||briks.w||'px;'||
      'height:'||briks.h||'px;' AS style, 
      'all' AS usr,
      briks.id AS id
FROM briks;

RENDER briks USING briks_rendering;
-- test
--insert into briks values (0,40,40,100,30);
 
