#!/usr/bin/perl -w

=begin comment

SQL Schema:

create table foo (foo_id int not null primary key auto_increment, bar text);

=cut


package My::DB;
use base q(Rose::DB);
__PACKAGE__->register_db(driver   => 'mysql',
                         database => 'test',
                         host     => $ENV{HOST},
                         username => $ENV{USER},
                         password => $ENV{PASS});

package My::DBObject;
use base 'Rose::DB::Object';

sub init_db {
    My::DB->new_or_cached();
}

package My::Foo;

use base 'My::DBObject';

__PACKAGE__->meta->table('foo');
__PACKAGE__->meta->auto_initialize;

package main;

use Storable qw(freeze thaw);
my $foo = My::Foo->new(bar => "bif");
$foo->save();

# this bombs for me
my $froze = freeze($foo);
