DBIx::Class::Smooth::Schema - Short intro
Version 0.0108, released 2020-11-29.
# in MyApp::Schema, instead of inheriting from DBIx::Class::Schema use parent 'DBIx::Class::Smooth::Schema';
DBIx::Class::Smooth::Schema adds method accessors for all resultsets.
In short, instead of this:
my $schema = MyApp::Schema->connect(...); my $result = $schema->resultset('Author');
You can do this:
my $schema = MyApp::Schema->connect(...); my $result = $schema->Author;
The resultset methods can be called in four different ways.
# $schema->resultset('Author') $schema->Author;
# $schema->resultset('Author')->find(5) $schema->Author(5);
# $schema->resultset('Book')->find({ author => 'J.R.R Tolkien', title => 'The Hobbit' }, { key => 'book_author_title' }); $schema->Book([book_author_title => { author => 'J.R.R Tolkien', title => 'The Hobbit' }]);
# $schema->resultset('Author')->search({ last_name => 'Tolkien'}, { order_by => { -asc => 'first_name' }}); $schema->Author({ last_name => 'Tolkien'}, { order_by => { -asc => 'first_name' }});
DBIx::Class::Smooth
https://github.com/Csson/p5-DBIx-Class-Smooth
https://metacpan.org/release/DBIx-Class-Smooth
Erik Carlsson <info@code301.com>
This software is copyright (c) 2018 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install DBIx::Class::Smooth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::Smooth
CPAN shell
perl -MCPAN -e shell install DBIx::Class::Smooth
For more information on module installation, please visit the detailed CPAN module installation guide.