OData::QueryParams::DBIC - parse OData style query params and provide info for DBIC queries.
version 0.01
use OData::QueryParams::DBIC; my $query_string = 'orderby=username asc, userid'; my $opts = params_to_dbic( $query_string ); # { order_by => [ {-asc => 'username'}, {-asc => 'userid'} ] } # can be used in # $schema->resultset('users')->search( undef, $opts );
The OData protocol defines the behaviour of Query String Options. This module aims to help you when you want to use the OData query string options with an application that uses DBIx::Class.
It parses the query parameters and creates a hash of DBIx::Class options that can be used in the search method.
This function returns a hash reference of options that can be used as options for the search method in DBIx::Class.
use OData::QueryParams::DBIC; my $query_string = 'orderby=username asc, userid'; my $opts = params_to_dbic( $query_string );
Renee Baecker <reneeb@cpan.org>
This software is Copyright (c) 2018 by Renee Baecker.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install OData::QueryParams::DBIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OData::QueryParams::DBIC
CPAN shell
perl -MCPAN -e shell install OData::QueryParams::DBIC
For more information on module installation, please visit the detailed CPAN module installation guide.