sub make_set {
my ($set, $crud) = @_;
DBIx::Data::Collection::Set->new(
+ set_over => [ 'id' ],
store => DBIx::Data::Store::CRUD->new(
raw_store => DBIx::Data::Store->connect($dsn),
select_sql => q{SELECT id, name FROM person},
'Basic data with class out ok'
);
+$set = make_set {}, {
+ insert_sql => q{INSERT INTO person (name) VALUES (?) },
+ insert_argument_order => [ 'name' ],
+ insert_command_constructor => sub {
+ require DBIx::Data::Store::Command::Insert::LastInsertId;
+ my $self = shift;
+ DBIx::Data::Store::Command::Insert::LastInsertId->new(
+ id_column => 'id',
+ raw_store => $self->raw_store,
+ insert_call_command => $self->raw_store->new_call_command(@_)
+ );
+ }
+};
+
+my $doug = $set->add({ name => 'Doug' });
+
+use Devel::Dwarn;
+
+Dwarn $doug;
+
done_testing;