has "${type}_argument_order" => (is => 'ro', default => sub { [] });
}
+has 'insert_command_constructor' => (is => 'ro');
+
has "select_column_order" => (is => 'ro');
method new_select_command ($args) {
[ @{$args}{@{$self->${\"${type}_argument_order"}}} ]
}
-method _new_call_command ($type, $args) {
+method _new_command ($builder, $type, $args) {
my $has_meth = "has_${type}_sql";
die "${self}->${has_meth}" unless $self->$has_meth;
- $self->raw_store->new_call_command(
+ $self->$builder(
$self->${\"${type}_sql"},
- $self->_unwrap_args_for($type => $args)
+ $self->_unwrap_args_for($type => $args),
+ );
+}
+
+method _new_call_command ($type, $args) {
+ $self->_new_command(
+ sub { shift->raw_store->new_call_command(@_) },
+ $type => $args,
);
}
method new_insert_command ($args) {
- $self->_new_call_command(insert => $args);
+ my $builder = $self->insert_command_constructor;
+ $builder
+ ? $self->_new_command($builder => insert => $args)
+ : $self->_new_call_command(insert => $args);
}
method new_update_command ($args) {