pudo / dataset

Easy-to-use data handling for SQL data stores with support for implicit table creation, bulk loading, and transactions.
https://dataset.readthedocs.org/
MIT License
4.78k stars 298 forks source link

Insert many with missing columns #252

Closed alexwennerberg closed 6 years ago

alexwennerberg commented 6 years ago

Hey I love this tool and I use it a lot because I am very lazy. However, something has impeded my laziness - I noticed that when I call insert_many with rows that don't all include all the columns that I am inserting, it returns an sqlalchemy error. That is to say, I have to figure out all the column headers first, then set all those values to None before I call insert_many. I looked briefly into the code and I think I understand why this is, I have been thinking about making a pull request that automatically sets any missing column's value to null when calling insert_many, but I was wondering if there is any reason why this change hasn't been made?

Hope this makes sense.

pudo commented 6 years ago

Agreed, that should be done automagically.