NAME

Mojolicious::Plugin::RoutesAuthDBI::POS::Pg - POS for PostgreSQL.

SYNOPSIS

use Mojolicious::Plugin::RoutesAuthDBI::POS::Pg;

my $sql = Mojolicious::Plugin::RoutesAuthDBI::POS::Pg->instance;
my $sth = $dbh->prepare($sql->{'name foo'});

SEE ALSO

DBIx::POS

SQL definitions

For access methods

  • ---------------------------------------------------------------------

    select *
    from users
    where id = ? or login=?
  • ---------------------------------------------------------------------

    select r.*, ac.controller, ac.namespace, ac.action, ac.callback, ac.id as action_id
    from routes r
      join refs rf on r.id=rf.id1
      join 
      (select a.*, c.controller, c.namespace
        from actions a 
        left join refs r on a.id=r.id2
        left join controllers c on c.id=r.id1
      ) ac on rf.id2=ac.id
    order by r.order_by, r.ts;
  • ---------------------------------------------------------------------

    select g.*
    from
      roles g
      join refs r on g.id=r.id1
    where r.id2=?;
    --and coalesce(g.disable, 0::bit) <> 1::bit
  • ---------------------------------------------------------------------

    select count(*)
    from refs
    where id1 = ? and id2 = ANY(?);
  • ----------------------------------------------------------------------

    select count(c.*)
    from 
      controllers c
      join refs r on c.id=r.id1
      join roles o on r.id2=o.id
    where
      lower(c.controller)=lower(?)
      and c.namespace=?
      and r.id2=any(?)
      and coalesce(o.disable, 0::bit) <> 1::bit
    ;
  • ----------------------------------------------------------------------

    select count(*)
    from roles
    where (id = ? or name = ?)
      and id = any(?)
    ;

For administration actions (controller)

  • ---------------------------------------------------------------------

    insert into users (login, pass) values (?,?)
    returning *;
  • ---------------------------------------------------------------------

    select *
    from roles
    where id=? or lower(name)=?
  • ---------------------------------------------------------------------

    insert into roles (name) values (?)
    returning *;
  • ---------------------------------------------------------------------

    update roles set disable=?::bit where id=? or lower(name)=?
    returning *;
  • ---------------------------------------------------------------------

    select *
    from refs
    where id1=? and id2=?;
  • ---------------------------------------------------------------------

    insert into refs (id1,id2) values (?,?)
    returning *;
  • ---------------------------------------------------------------------

    delete from refs
    where id1=? and id2=?
    returning *;
  • ---------------------------------------------------------------------

    select *
    from controllers
    where
      namespace=?
      and lower(controller)=lower(?)
  • ---------------------------------------------------------------------

    insert into controllers (namespace, controller)
    values (?,?)
    returning *;
  • ---------------------------------------------------------------------

    insert into routes (request, name, auth, descr, disable, order_by)
    values (?,?,?,?,?,?,?,?,?)
    returning *;
  • ---------------------------------------------------------------------

    select u.*
    from
      users u
      join refs r on u.id=r.id2
    where r.id1=?;
  • ---------------------------------------------------------------------

    select t.*
    from
      routes t
      join refs r on t.id=r.id1
    where r.id2=?;
  • ---------------------------------------------------------------------

    select * from controllers;
  • ---------------------------------------------------------------------

    select * from controllers where namespace = ? and controller = ?;
  • ---------------------------------------------------------------------

    insert into controllers (namespace, controller) values (?,?)
    returning *;
  • ---------------------------------------------------------------------

    select a.*, c.namespace, c.controller
    from actions a
      left join refs r on a.id=r.id2
      left join controllers c on c.id=r.id1
  • ---------------------------------------------------------------------

69 POD Errors

The following errors were encountered while parsing the POD:

Around line 32:

Unknown directive: =name

Around line 34:

Unknown directive: =desc

Around line 36:

Unknown directive: =sql

Around line 44:

Unknown directive: =name

Around line 46:

Unknown directive: =desc

Around line 48:

Unknown directive: =sql

Around line 63:

Unknown directive: =name

Around line 65:

Unknown directive: =desc

Around line 67:

Unknown directive: =sql

Around line 78:

Unknown directive: =name

Around line 80:

Unknown directive: =desc

Around line 82:

Unknown directive: =sql

Around line 90:

Unknown directive: =name

Around line 92:

Unknown directive: =desc

Around line 94:

Unknown directive: =sql

Around line 110:

Unknown directive: =name

Around line 112:

Unknown directive: =desc

Around line 114:

Unknown directive: =sql

Around line 130:

Unknown directive: =name

Around line 132:

Unknown directive: =desc

Around line 134:

Unknown directive: =sql

Around line 141:

Unknown directive: =name

Around line 143:

Unknown directive: =desc

Around line 145:

Unknown directive: =sql

Around line 153:

Unknown directive: =name

Around line 155:

Unknown directive: =desc

Around line 157:

Unknown directive: =sql

Around line 164:

Unknown directive: =name

Around line 166:

Unknown directive: =desc

Around line 168:

Unknown directive: =sql

Around line 175:

Unknown directive: =name

Around line 177:

Unknown directive: =desc

Around line 179:

Unknown directive: =sql

Around line 187:

Unknown directive: =name

Around line 189:

Unknown directive: =desc

Around line 191:

Unknown directive: =sql

Around line 199:

Unknown directive: =name

Around line 201:

Unknown directive: =desc

Around line 203:

Unknown directive: =sql

Around line 211:

Unknown directive: =name

Around line 213:

Unknown directive: =desc

Around line 215:

Unknown directive: =sql

Around line 225:

Unknown directive: =name

Around line 227:

Unknown directive: =desc

Around line 229:

Unknown directive: =sql

Around line 237:

Unknown directive: =name

Around line 239:

Unknown directive: =desc

Around line 241:

Unknown directive: =sql

Around line 249:

Unknown directive: =name

Around line 251:

Unknown directive: =desc

Around line 253:

Unknown directive: =sql

Around line 263:

Unknown directive: =name

Around line 265:

Unknown directive: =desc

Around line 267:

Unknown directive: =sql

Around line 278:

Unknown directive: =name

Around line 280:

Unknown directive: =desc

Around line 282:

Unknown directive: =sql

Around line 288:

Unknown directive: =name

Around line 290:

Unknown directive: =desc

Around line 292:

Unknown directive: =sql

Around line 298:

Unknown directive: =name

Around line 300:

Unknown directive: =desc

Around line 302:

Unknown directive: =sql

Around line 310:

Unknown directive: =name

Around line 312:

Unknown directive: =desc

Around line 314:

Unknown directive: =sql

Around line 323:

Unknown directive: =name

Around line 325:

Unknown directive: =desc

Around line 327:

Unknown directive: =sql