Add delete_by_{nonunique_column} method to #[spacetimedb(table)]
#859
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
bindings::query::delete_by_fieldto requireFilterableValueand returnu32count of deleted rows.bindings::query::delete_by_unique_fieldwith the previous behavior ofdelete_by_field, i.e. requiringUniqueValueand returningboolwithtrue = deleted. This is implemented in terms ofdelete_by_field.delete_by_unique_fieldrather thandelete_by_field.::delete_by_{field}for both unique and non-unique columns to therust-wasm-testmodule, so we can see that they compile as expected.Note that this PR does not include any host-side changes; the diff is localized to the
bindingsandbindings-macrocrates.Something to think about: it's possible we should not be emitting
filter_by_{field}ordelete_by_{field}methods for columns/fields which do not have an index, on the grounds that table scans for filtering are very slow and bad, and a performing such a filter is almost certainly a bug in the module. This PR does not change our existing behavior, which is to generate the methods for any field/column with a filterable type, even if unindexed.API and ABI breaking changes
N/A -
bindings::queryis for internal use only and is marked#[doc(hidden)].Expected complexity level and risk