clockworklabs / spacetime-docs

Apache License 2.0
6 stars 11 forks source link

Update docs to show that tables need to be explicitly marked public #60

Closed cloutiertyler closed 3 months ago

cloutiertyler commented 4 months ago

Consider writing roughly, on the first #[spacetimedb(table)] definition:

Adding the public marker to a table allows clients to query and subscribe to the table. By default, tables are private, meaning they're visible only within reducers and to the module owner's SQL queries. It's important that private is the default so you don't accidentally make a table which contains sensitive information public, but in this case we want clients to be able to subscribe to {description of this table}, so we'll mark {this table} as public.

And on the second definition:

As with {previous table}, we want clients to be able to subscribe to {description of this table}, so we'll mark {this table} as public.