Skip to content
DBIx::Class Plugin for Dancer
Perl
Pull request Compare This branch is 3 commits ahead, 71 commits behind ironcamel:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib/Dancer/Plugin
t
.gitignore
README
dist.ini

README

#!/usr/bin/env perl

use Dancer;
use Dancer::Plugin::DBIC;
#use Dancer::Plugin::DBIC qw(schema); # explicit import if you like

get '/profile/:id' => sub {
    my $user = schema->resultset('Users')->find(params->{id});
    # or explicitly ask for a schema by name:
    $user = schema('foo')->resultset('Users')->find(params->{id});
    template user_profile => { user => $user };
};

dance;

# Dancer Configuration File

plugins:
  DBIC:
    foo:
      dsn:  "dbi:mysql:db_foo"
      user: "root"
      pass: "****"
      options:
        RaiseError: 1
        PrintError: 1
Something went wrong with that request. Please try again.