Skip to content

Commit 3b5c091

Browse files
authored
RLS Documentation - Invalid SQL Query (#351)
Added missing required column identifier to simple query RLS documentation examples.
1 parent 7d00e11 commit 3b5c091

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/rls/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use spacetimedb::{client_visibility_filter, Filter};
3333
/// A client can only see their account
3434
#[client_visibility_filter]
3535
const ACCOUNT_FILTER: Filter = Filter::Sql(
36-
"SELECT * FROM account WHERE identity = :sender"
36+
"SELECT * FROM account WHERE account.identity = :sender"
3737
);
3838
```
3939
:::
@@ -52,7 +52,7 @@ public partial class Module
5252
/// </summary>
5353
[SpacetimeDB.ClientVisibilityFilter]
5454
public static readonly Filter ACCOUNT_FILTER = new Filter.Sql(
55-
"SELECT * FROM account WHERE identity = :sender"
55+
"SELECT * FROM account WHERE account.identity = :sender"
5656
);
5757
}
5858
```
@@ -90,7 +90,7 @@ use spacetimedb::{client_visibility_filter, Filter};
9090
/// A client can only see their account
9191
#[client_visibility_filter]
9292
const ACCOUNT_FILTER: Filter = Filter::Sql(
93-
"SELECT * FROM account WHERE identity = :sender"
93+
"SELECT * FROM account WHERE account.identity = :sender"
9494
);
9595

9696
/// An admin can see all accounts
@@ -113,7 +113,7 @@ public partial class Module
113113
/// </summary>
114114
[SpacetimeDB.ClientVisibilityFilter]
115115
public static readonly Filter ACCOUNT_FILTER = new Filter.Sql(
116-
"SELECT * FROM account WHERE identity = :sender"
116+
"SELECT * FROM account WHERE account.identity = :sender"
117117
);
118118

119119
/// <summary>
@@ -141,7 +141,7 @@ use spacetimedb::{client_visibility_filter, Filter};
141141
/// A client can only see their account
142142
#[client_visibility_filter]
143143
const ACCOUNT_FILTER: Filter = Filter::Sql(
144-
"SELECT * FROM account WHERE identity = :sender"
144+
"SELECT * FROM account WHERE account.identity = :sender"
145145
);
146146

147147
/// An admin can see all accounts
@@ -170,7 +170,7 @@ public partial class Module
170170
/// </summary>
171171
[SpacetimeDB.ClientVisibilityFilter]
172172
public static readonly Filter ACCOUNT_FILTER = new Filter.Sql(
173-
"SELECT * FROM account WHERE identity = :sender"
173+
"SELECT * FROM account WHERE account.identity = :sender"
174174
);
175175

176176
/// <summary>

0 commit comments

Comments
 (0)