Warn

POD ERRORS here is normal because DBIx::POS::Template used.

Mojolicious::Plugin::RoutesAuthDBI::POS::Admin

¡ ¡ ¡ ALL GLORY TO GLORIA ! ! !

NAME

Mojolicious::Plugin::RoutesAuthDBI::POS::Admin - POS-dict for admin actions Admin.pm.

DB DESIGN DIAGRAM

See https://github.com/mche/Mojolicious-Plugin-RoutesAuthDBI/blob/master/Diagram.svg

SYNOPSIS

my $pos = Mojolicious::Plugin::RoutesAuthDBI::POS::Admin->new(template=>{tables=>{...}});

my $sth = $dbh->prepare($pos->{'foo'});

Methods

One new()

new()

Input args for new:

template - hashref

Vars for template system of POS-statements.

SEE ALSO

DBIx::POS::Template

SQL definitions

new profile

insert into "{% $schema %}"."{% $tables{profiles} %}" (names) values (?)
returning *;

new login

insert into "{% $schema %}"."{% $tables{logins} %}" (login, pass) values (?,?)
returning *;

role

select *
from "{% $schema %}"."{% $tables{roles} %}"
where id=? or lower(name)=?

new role

insert into "{% $schema %}"."{% $tables{roles} %}" (name) values (?)
returning *;

dsbl/enbl role

update "{% $schema %}"."{% $tables{roles} %}" set disable=?::bit where id=? or lower(name)=?
returning *;

ref

select *
from "{% $schema %}"."{% $tables{refs} %}"
where id1=? and id2=?;

new ref

insert into "{% $schema %}"."{% $tables{refs} %}" (id1,id2) values (?,?)
returning *;

del ref

delete from "{% $schema %}"."{% $tables{refs} %}"
where id1=? and id2=?
returning *;

new controller

insert into "{% $schema %}"."{% $tables{controllers} %}" (controller, descr)
values (?,?)
returning *;

action routes

маршрут может быть не привязан к действию

select * from (
select r.*, s.action_id
from "{% $schema %}"."{% $tables{routes} %}" r
  left join (
   select s.id1, a.id as action_id
   from "{% $schema %}"."{% $tables{refs} %}" s
    join "{% $schema %}"."{% $tables{actions} %}" a on a.id=s.id2
  ) s on r.id=s.id1
) s
{% $where %}; -- action_id is null - free routes; or action(id) routes
;

new route

insert into "{% $schema %}"."{% $tables{routes} %}" (request, name, descr, auth, disable, interval_ts)
values (?,?,?,?,?,?)
returning *;

role profiles

Пользователи роли

select p.*
from
  "{% $schema %}"."{% $tables{profiles} %}" p
  join "{% $schema %}"."{% $tables{refs} %}" r on p.id=r.id2
where r.id1=?;

role routes

Маршруты роли/действия

select t.*
from
  "{% $schema %}"."{% $tables{routes} %}" t
  join "{% $schema %}"."{% $tables{refs} %}" r on t.id=r.id1
where r.id2=?;

controllers

select c.*, n.namespace, n.id as namespace_id, n.descr as namespace_descr
  from "{% $schema %}"."{% $tables{controllers} %}" c
  left join "{% $schema %}"."{% $tables{refs} %}" r on c.id=r.id2
  left join "{% $schema %}"."{% $tables{namespaces} %}" n on n.id=r.id1
  {% $where %};

namespace

select *
from "{% $schema %}"."{% $tables{namespaces} %}"
where id=? or namespace = ?;

new namespace

insert into "{% $schema %}"."{% $tables{namespaces} %}" (namespace, descr, app_ns, interval_ts) values (?,?,?,?)
returning *;

actions

Список действий

select * from (
select a.*, ac.controller_id, ac.controller
from "{% $schema %}"."{% $tables{actions} %}" a
  left join (
    select a.id, c.id as controller_id, c.controller
    from "{% $schema %}"."{% $tables{actions} %}" a
      join "{% $schema %}"."{% $tables{refs} %}" r on a.id=r.id2
      join "{% $schema %}"."{% $tables{controllers} %}" c on c.id=r.id1
    ) ac on a.id=ac.id-- действия с контроллером
) as a
{% $where %}

new action

insert into "{% $schema %}"."{% $tables{actions} %}" (action, callback, descr)
values (?,?,?)
returning *;

profiles

select p.*, l.login, l.pass
from "{% $schema %}"."{% $tables{profiles} %}" p
left join (
  select l.*, r.id1
  from "{% $schema %}"."{% $tables{refs} %}" r 
    join "{% $schema %}"."{% $tables{logins} %}" l on l.id=r.id2
) l on p.id=l.id1

тест

тест

ыудусе * акщь тест!ж

59 POD Errors

The following errors were encountered while parsing the POD:

Around line 63:

Unknown directive: =name

Around line 65:

Unknown directive: =desc

Around line 67:

Unknown directive: =sql

Around line 74:

Unknown directive: =name

Around line 76:

Unknown directive: =desc

Around line 78:

Unknown directive: =sql

Around line 85:

Unknown directive: =name

Around line 87:

Unknown directive: =desc

Around line 89:

Unknown directive: =sql

Around line 97:

Unknown directive: =name

Around line 99:

Unknown directive: =desc

Around line 101:

Unknown directive: =sql

Around line 108:

Unknown directive: =name

Around line 110:

Unknown directive: =desc

Around line 112:

Unknown directive: =sql

Around line 119:

Unknown directive: =name

Around line 121:

Unknown directive: =desc

Around line 123:

Unknown directive: =sql

Around line 131:

Unknown directive: =name

Around line 133:

Unknown directive: =desc

Around line 135:

Unknown directive: =sql

Around line 143:

Unknown directive: =name

Around line 145:

Unknown directive: =desc

Around line 147:

Unknown directive: =sql

Around line 157:

Unknown directive: =name

Around line 159:

Unknown directive: =desc

Around line 161:

Unknown directive: =sql

Around line 169:

Unknown directive: =name

Around line 171:

Unknown directive: =desc

Around line 175:

Unknown directive: =sql

Around line 192:

Unknown directive: =name

Around line 194:

Unknown directive: =desc

Around line 196:

Unknown directive: =sql

Around line 204:

Unknown directive: =name

Around line 206:

Unknown directive: =desc

Around line 210:

Unknown directive: =sql

Around line 220:

Unknown directive: =name

Around line 222:

Unknown directive: =desc

Around line 226:

Unknown directive: =sql

Around line 237:

Unknown directive: =name

Around line 239:

Unknown directive: =desc

Around line 241:

Unknown directive: =sql

Around line 251:

Unknown directive: =name

Around line 253:

Unknown directive: =desc

Around line 255:

Unknown directive: =sql

Around line 263:

Unknown directive: =name

Around line 265:

Unknown directive: =desc

Around line 267:

Unknown directive: =sql

Around line 275:

Unknown directive: =name

Around line 277:

Unknown directive: =desc

Around line 281:

Unknown directive: =sql

Around line 297:

Unknown directive: =name

Around line 299:

Unknown directive: =desc

Around line 301:

Unknown directive: =sql

Around line 309:

Unknown directive: =name

Around line 311:

Unknown directive: =sql

Around line 324:

Unknown directive: =name

Around line 326:

Unknown directive: =desc

Around line 330:

Unknown directive: =sql