(ctx: &ReducerContext, name: String)
| 378 | |
| 379 | #[spacetimedb::reducer] |
| 380 | pub fn add_player(ctx: &ReducerContext, name: String) -> Result<(), String> { |
| 381 | // This always creates a new one because id is auto-incremented. |
| 382 | let inserted = ctx.db.test_e().id().try_insert_or_update(TestE { id: 0, name })?; |
| 383 | |
| 384 | // Since the previous one is always inserted, at this point it's always updated by this function. |
| 385 | // This is a no-op, but we can still call it. |
| 386 | ctx.db.test_e().id().try_insert_or_update(inserted)?; |
| 387 | |
| 388 | Ok(()) |
| 389 | } |
| 390 | |
| 391 | #[spacetimedb::reducer] |
| 392 | pub fn delete_player(ctx: &ReducerContext, id: u64) -> Result<(), String> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…