This is really silly-- but it happens at 2am

This is less of a bug, and more of rose not catching human error.

if you use_key on the primary key, rose doesn't do anything.  no  
error, just a dbd error ( in my case, DBD::Pg::st execute failed:  
ERROR:  syntax error at end of input at character 146 )

the issue is that rose doesn't add anything to the where clause

it makes perfect sense why that doesn't work, it would just be nice  
for rose to pick the error up

there's an illustration below

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

package MyApp::RoseDB::Object::Item;
use strict;
use base qw(MyApp::RoseDB::Object);
__PACKAGE__->meta->setup(
     table   => 'item',
     columns => [
         id             => { type => 'bigint', not_null => 1 },
         name   => { type => 'varchar', length => 32 },
     ],
     primary_key_columns => [ 'id ' ],
);


package main;
$Rose::DB::Object::Debug= 1;
eval {
        my      $obj= MyApp::RoseDB::Object::Item->new(
                                id=> 10 ,
                        );
                $obj->load( use_key=> 'id'  );
};
$Rose::DB::Object::Debug= 0;

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

STDERR-
        SELECT id , name FROM item WHERE  - bind params:

note how there is no where clause, if 'use_key' is removed, we get
        SELECT id , name FROM item WHERE id = ? - bind params: 10




// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
| SyndiClick.com
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|      FindMeOn.com - The cure for Multiple Web Personality Disorder
|      Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|      RoadSound.com - Tools For Bands, Stuff For Fans
|      Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to