You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ActiveRecord::StatementInvalid:
SQLite3::SQLException: all VALUES must have the same number of terms: INSERT INTO "sample_records"
(name, age, created_at, updated_at)
VALUES
('Foo', 30, '2017-05-04 12:44:57.825195', '2017-05-04 12:44:57.825195'),('Bar', '2017-05-04 12:44:57.825351', '2017-05-04 12:44:57.825351')
# ./lib/active_record_bulk_insert.rb:40:in `bulk_insert'
# ./spec/sample_record_spec.rb:24:in `block (4 levels) in <top (required)>'
# ./spec/sample_record_spec.rb:24:in `block (3 levels) in <top (required)>'
There was a problem on my project, I've fixed it, shared results, I'm ok with fork.
What I don't agree with is
ensuring that the hashes passed in contains the same set of keys and a default supplied to normalize hashes with fewer keys should be the job of whatever calls bulk_insert and not bulk_insert.
If you allow the exception to propagate this should be reflected in the API. Just and bang bulk_insert!, describe input requirements in README and that's it.
Once run
bulk_insert
with non constant attributes countIt fails
As you can see it does not fill gap
The text was updated successfully, but these errors were encountered: