NAME
    DBIx::Class::ResultSet::Void - improve DBIx::Class::ResultSet with void
    context

VERSION
    version 0.01

SYNOPSIS
        my $rs = $schema->resultset('CD');
        $rs->find_or_create( {
            artist => 'Massive Attack',
            title  => 'Mezzanine',
        } );

    As ResultSet subclass in Schema.pm:

        __PACKAGE__->load_namespaces(
            default_resultset_class => '+DBIx::Class::ResultSet::Void'
        );

    Or in Schema/CD.pm

        __PACKAGE__->resultset_class('DBIx::Class::ResultSet::Void');

    Or in ResultSet/CD.pm

        use base 'DBIx::Class::ResultSet::Void';

DESCRIPTION
    The API is the same as DBIx::Class::ResultSet.

    use "count" instead of "find" unless defined wantarray.

  METHODS
    *   find_or_create

        "find_or_create" in DBIx::Class::ResultSet:

            $rs->find_or_create( { id => 1, name => 'A' } );

        produces SQLs like:

            # SELECT me.id, me.name FROM item me WHERE ( me.id = ? ): '1'
            # INSERT INTO item ( id, name) VALUES ( ?, ? ): '1', 'A'

        but indeed COUNT(*) is performing a little better than me.id,
        me.name

        this module DBIx::Class::ResultSet::Void produces SQLs like:

            # SELECT COUNT( * ) FROM item me WHERE ( me.id = ? ): '1'
            # INSERT INTO item ( id, name) VALUES ( ?, ? ): '1', 'A'

        we would delegate it DBIx::Class::ResultSet under context like:

            my $row = $rs->find_or_create( { id => 1, name => 'A' } );

    *   update_or_create

        "update_or_create" in DBIx::Class::ResultSet:

            $rs->update_or_create( { id => 1, name => 'B' } );

        produces SQLs like:

            # SELECT me.id, me.name FROM item me WHERE ( me.id = ? ): '1'
            # UPDATE item SET name = ? WHERE ( id = ? ): 'B', '1'

        this module:

            # SELECT COUNT( * ) FROM item me WHERE ( me.id = ? ): '1'
            # UPDATE item SET name = ? WHERE ( id = ? ): 'B', '1'

AUTHOR
      Fayland Lam <fayland@gmail.com>

COPYRIGHT AND LICENSE
    This software is copyright (c) 2009 by Fayland Lam.

    This is free software; you can redistribute it and/or modify it under
    the same terms as perl itself.

