Anvil | Smiths Smiths | Register Register | Login Login |
Search:
Show links Show tools Show tree | Previous document Next document | njet.org > Anvil > Documentation > Configuration > Providers > DBRealm

anvil.server.db.DBRealm

property default description
pool (required) Indicates the name of visible pool pointing to database containing the SQL schema below.
cachesize 32 Size of memory cache for keeping the tribe and citizens temporarily on memory.

SQL Schema:
create table entity
(
  id           int unsigned not null,
  type         enum ('t', 'c'),
  name         varchar(64) not null,
  credentials  varchar(32),

  primary key  (id),  
  key          (name)
);

create table relation
(
  parent  int unsigned not null,
  child   int unsigned not null,
  type    enum ('t', 'c'),
  
  key    (parent),
  key    (child)
);

create table attribute
(
  id       int unsigned not null,
  pos      int unsigned not null,
  name     varchar(255) not null,
  isstring bool,
  value    mediumtext not null,
  
  key (id),
  key (name)
);

create table permission
(
  id      int unsigned not null,
  type    varchar(255) not null,
  name    varchar(255) not null,
  actions varchar(255) not null,
  
  key (id)
);

insert into entity values(1, 't', 'root', null);
insert into entity values(2, 'c', 'root', 'boot');
insert into relation values(1, 2, 'c');
insert into relation values(0, 1, 't');

See also  | Providers
What's new | Anvil