-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
Supporting multi-row inserts with IEnumerable<IEnumerable<KeyValuePair<string, object>>> #663
Comments
My PR #548 do more changes than one more overload, because with bigger queries unnecessary cast lead to poor performance. |
Hi,
Since SqlKata supports creating insert queries from an
IEnumerable<KeyValuePair<string, object>>
, I think it would be great if we can also have anAsInsert()
overload that takes an enumerable of that. List of dictionaries are quite common as a data structure as well, so I think this will be a useful addition.I am interested in making a PR myself to implement that, but there's just one thing I'm not sure about - the most common implementation of
IEnumerable<IEnumerable<KeyValuePair<string, object>>>
might just be a list of dictionaries, and ordering of key-value pairs in dictionaries are not promised. Hence the code will need to reorder the entries, or iterate through the keys obtained from the first dictionary for every subsequent dictionary in the list to produce the correct output every time. Not very sure if this will be a concern (performance?) or which is the better approach in this case, so I hope to have some discussion on this before I start to try working on this :)I also noticed that there was this PR #548 which seems to cover this (except for the ordering concern), but it's quite old and includes much more changes other than this.
The text was updated successfully, but these errors were encountered: