Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions crates/bindings-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,20 +711,6 @@ fn spacetimedb_tabletype_impl(item: syn::DeriveInput) -> syn::Result<TokenStream
}
};

let db_delete = quote! {
#[allow(unused_variables)]
pub fn delete(f: fn (#original_struct_ident) -> bool) -> usize {
panic!("Delete using a function is not supported yet!");
}
};

let db_update = quote! {
#[allow(unused_variables)]
pub fn update(value: #original_struct_ident) -> bool {
panic!("Update using a value is not supported yet!");
}
};

let db_iter = quote! {
#[allow(unused_variables)]
pub fn iter() -> spacetimedb::TableIter<Self> {
Expand Down Expand Up @@ -828,8 +814,6 @@ fn spacetimedb_tabletype_impl(item: syn::DeriveInput) -> syn::Result<TokenStream

impl #original_struct_ident {
#db_insert
#db_delete
#db_update
#(#unique_filter_funcs)*
#(#unique_update_funcs)*
#(#unique_delete_funcs)*
Expand Down
7 changes: 0 additions & 7 deletions test/tests/filtering.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ pub fn insert_nonunique_person(id: i32, name: String, is_human: bool) {
NonuniquePerson::insert(NonuniquePerson { id, name, is_human } );
}

// FIXME: the `delete` functionality on things without unique columns takes a function pointer, not a generic! This means closures can't capture!
#[spacetimedb(reducer)]
pub fn delete_nonunique_person_103() {
NonuniquePerson::delete((|nup| nup.id == 103) as fn(_: NonuniquePerson) -> bool);
}

#[spacetimedb(reducer)]
pub fn find_nonunique_person(id: i32) {
for person in NonuniquePerson::filter_by_id(&id) {
Expand Down Expand Up @@ -263,7 +257,6 @@ run_test cargo run logs "$IDENT" 100
# run_test cargo run call "$IDENT" insert_nonunique_person 102 "Fi"
# run_test cargo run call "$IDENT" insert_nonunique_person 103 Fo
# run_test cargo run call "$IDENT" insert_nonunique_person 104 Fum
# run_test cargo run call "$IDENT" delete_nonunique_person_103
# run_test cargo run call "$IDENT" find_nonunique_person 104
# run_test cargo run logs "$IDENT" 100
# [ ' NONUNIQUE FOUND: id 104: Fum' == "$(grep 'NONUNIQUE FOUND: id 104: Fum' "$TEST_OUT" | tail -n 4 | cut -d: -f4-)" ]
Expand Down