-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bulk Insert support? #61
Comments
Yes, i would like to see bulk inserts too. But getting the code right is not so easy. |
Is there a problem with my approach of overwriting _insert_HASHREF? or is it better to make a seperate bulk_insert function maybe? |
I added bulk insert support to DBIx::Array you are more than welcome to see how that was implemented. https://metacpan.org/pod/DBIx::Array#METHODS-(Write)-Bulk-SQL |
This would be a nice thing to have. |
Note that |
I found a workaround! Since package My::Model {
use Mojo::Base -base, -signatures;
use SQL::Abstract::Plugin::InsertMulti;
has 'pg';
sub insert_multi_p ( $self, $table, $data, $opts = {} ) {
my ( $stmt, @bind ) =
$self->pg()->abstract()->insert_multi( $table, $data, $opts );
return $self->pg()->db()->query_p( $stmt, @bind );
}
};
1; So far, it works well. I hope it solves the problem for everyone else. |
It would be nice to support multiple inserts in a single statement, especially non-blocking.
Maybe something like this?
Then backend something like this?
The text was updated successfully, but these errors were encountered: