use deprecated RLS until views work in bevy_stdb

This commit is contained in:
Tao Tien 2026-02-11 01:18:24 -08:00
parent f6bd7fd6f7
commit 7cef787f38
4 changed files with 32 additions and 29 deletions

View file

@ -1,4 +1,4 @@
use spacetimedb::{Identity, SpacetimeType, table};
use spacetimedb::{Filter, Identity, SpacetimeType, client_visibility_filter, table};
use jong_types::*;
@ -63,7 +63,15 @@ pub struct Wall {
pub tiles: Vec<Tile>,
}
#[table(name = hand)]
// TODO temp use deprecated RLS instead of view until bevy_spacetimedb supp is better
#[client_visibility_filter]
const HAND_FILTER: Filter = Filter::Sql(
"SELECT h.* FROM hand h
JOIN player p ON h.id = p.hand_id
WHERE p.identity = :sender",
);
#[table(name = hand, public)]
pub struct Hand {
#[primary_key]
#[auto_inc]