Last Moose

It the last operator day here in the Moose-Pen

Well today is a very short postette but at least I am adding in the last operator 'ANY' and this time I need only this test;

 {
        caption    => 'ANY Operator with Data::Accessor',
        key        => 'conditions',
        conditions => [
            {
                left => {value=>Test::Utils::in_da_sql()},
                operator => 'ANY',
              },
        ],
        create => {
            container => $container,
            sql =>
              "INSERT INTO people ( first_name, last_name ) VALUES( ?, ? )",
            params => $params
        },
        retrieve => {
            sql =>
"SELECT people.first_name, people.last_name, people.user_id FROM people WHERE ANY (SELECT address.user_id FROM address WHERE address.country = ?)",
            params => ['CA']
        },
        update => {
            container => $container,
            sql =>
"UPDATE people SET first_name = ?, last_name = ? WHERE ANY (SELECT address.user_id FROM address WHERE address.country = ?)",
 params => [ 'Bill', 'Bloggings','CA' ]
        },
        delete => {
            sql    => "DELETE FROM people WHERE ANY (SELECT address.user_id FROM address WHERE address.country = ?)",
            params => ['CA']
        },
    },
and not the 'exception' test as I have already tested that with the exception test for 'All'. If it will work for 'All' then it will work for 'Any' as well.

Again all I need to do is add in the constants and this this patch to Driver::DBI;


...
elsif ($predicate->operator eq Database::Accessor::Driver::DBI::SQL::EXISTS
           or $predicate->operator eq Database::Accessor::Driver::DBI::SQL::NOT_EXISTS
           or $predicate->operator eq Database::Accessor::Driver::DBI::SQL::ALL
 ++          or $predicate->operator eq Database::Accessor::Driver::DBI::SQL::ANY) {
...
and now I have 130 passing tests.

Now to move onto something else.

sa98-23.jpg

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations