The InsertStatement builder doesn't seem to support adding a dynamic number of items without breaking the functional pattern exhibited throughout the docs. I went ahead and added a method for it since it was pretty simple and was a nice quality of life feature.
Though I've got a PR here, there are a few points that I'd like to ask about:
[ ] I'm not sure I've chosen a good name for the function. If you have any suggestions or preferences for a better name, please let me know and I can update the PR.
[ ] The method I've added wraps .values_panic, but I've not added an equivalent method for wrapping .values. I wasn't sure what behavior would be expected of such a function, so I figured I should ask first.
The two options I see are:
continues iterating when .values returns an Err, but collects the failing items and their errors so that all failures can be returned. I thought briefly about what this interface might look like but I'm not really sure (not sure if that means it's just a bad idea? π )
New Features
[ ] Added the values_from_panic method to InsertStatement for adding multiple rows at once from something that implements IntoIterator.
let rows = vec![
[2.1345.into(), "24B".into()],
[5.15.into(), "12A".into()],
];
let query = Query::insert()
.into_table(Glyph::Table)
.columns([Glyph::Aspect, Glyph::Image])
.values_from_panic(rows)
.to_owned();
PR Info
Hey again! π
The
InsertStatement
builder doesn't seem to support adding a dynamic number of items without breaking the functional pattern exhibited throughout the docs. I went ahead and added a method for it since it was pretty simple and was a nice quality of life feature.Though I've got a PR here, there are a few points that I'd like to ask about:
[ ] I'm not sure I've chosen a good name for the function. If you have any suggestions or preferences for a better name, please let me know and I can update the PR.
[ ] The method I've added wraps
.values_panic
, but I've not added an equivalent method for wrapping.values
. I wasn't sure what behavior would be expected of such a function, so I figured I should ask first. The two options I see are:Ok
and early exits on firstErr
.values
returns anErr
, but collects the failing items and their errors so that all failures can be returned. I thought briefly about what this interface might look like but I'm not really sure (not sure if that means it's just a bad idea? π )New Features
[ ] Added the
values_from_panic
method toInsertStatement
for adding multiple rows at once from something that implementsIntoIterator
.Bug Fixes
Breaking Changes
Changes