}
method _remove_from_store ($old) {
- $self->_store->new_delete_command($self->_deflate($old))->execute
+ $self->_store->new_delete_single_command($self->_deflate($old))->execute
}
method _remove_from_caches ($old) {
# this is currently a call command but we should think about it
# being a row command so that we can have RETURNING or other
# mechanisms handle things like set-on-update datetime values
- $self->_store->new_update_command($self->_deflate($obj))->execute
+ $self->_store->new_update_single_command($self->_deflate($obj))->execute
}
1;
has raw_store => (is => 'ro', required => 1); # DBIx::Data::Store object
-foreach my $type (qw(select select_single insert update delete)) {
+foreach my $type (qw(select select_single insert update update_single delete delete_single)) {
has "${type}_sql" => (is => 'ro', predicate => "has_${type}_sql");
has "${type}_argument_order" => (is => 'ro', default => sub { [] });
}
$self->_new_call_command(delete => $args);
}
+method new_update_single_command ($args) {
+ $self->_new_call_command(update_single => $args);
+}
+
+method new_delete_single_command ($args) {
+ $self->_new_call_command(delete_single => $args);
+}
+
__PACKAGE__->meta->make_immutable;
1;
insert_call_command => $self->raw_store->new_call_command(@_)
);
},
- delete_sql => q{DELETE FROM person WHERE id = ?},
- delete_argument_order => [ 'id' ],
+ delete_single_sql => q{DELETE FROM person WHERE id = ?},
+ delete_single_argument_order => [ 'id' ],
};
my $doug = $set->add({ name => 'Doug' });
is_deeply([ sort_set $set->flatten ], \@expect, 'new row still gone on reload');
$set = make_set {}, {
- update_sql => q{UPDATE person SET name = ? WHERE id = ?},
- update_argument_order => [ qw(name id) ]
+ update_single_sql => q{UPDATE person SET name = ? WHERE id = ?},
+ update_single_argument_order => [ qw(name id) ]
};
my ($pterry) = grep $_->{name} eq 'Pterry', $set->flatten;