The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Search::Query::Dialect::DBIxClass - Search::Query dialect for simple DBIx::Class query generation

VERSION

version 0.005

SYNOPSIS

    use Test::DBIx::Class::Example::Schema;
    use Search::Query;

    my $schema = Test::DBIx::Class::Example::Schema->connect();
    my $query = Search::Query->parser(
            dialect => 'DBIxClass',
            default_field => [qw( name description )],
        )->parse('foo bar -baz');
    my $rs = $schema->resultset('Foo')->search($query->as_dbic_query);

DESCRIPTION

Search::Query::Dialect::DBIxClass extends Search::Query::Dialect::Native by an as_dbic_query method that returns a hashref that can be passed to "search" in DBIx::Class::ResultSet.

METHODS

BUILD

Overrides base method and sets DBIx::Class-appropriate defaults. It adds '!#' to the op_regex which is the 'not in list of values' operator.

as_dbic_query

    Returns the query as hashref that can be passed to
    L<DBIx::Class::ResultSet/search>.

AUTHOR

Alexander Hartmaier <abraxxa@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Alexander Hartmaier.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.