DBIx-Struct
view release on metacpan or search on metacpan
How to access this structure
# get session object
my $session = one_row("session", {session => $input->{session}, ip => $input->{ip}});
# throw exception when there's no session
NoUser->throw("User is not logged in or does not exist") unless defined $session;
# get client's row
my $client = $session->Client;
# strip microseconds part
$client->filter_timestamp;
# throw exception if client is blocked
BlkUser->throw if $client->state eq 'blocked';
# set expire date
$session->expire(\"now() + interval '2 day'");
# update session
$session->update;
# get usd client's balance from client_balance
my $usd_balance = $client->refClientBalance(currency => "USD");
To use SQL
use DBIx::Struct qw(connector);
( run in 0.491 second using v1.01-cache-2.11-cpan-49f99fa48dc )