From f5d5d641e72bd96223476ed42f9289e2a7a7a35f Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Mon, 3 Mar 2025 14:31:56 -0500 Subject: [PATCH 1/7] Remove hedging about table access from module quickstarts We'll announce RLS when we announce it. For now, what we have is what we have. --- docs/modules/c-sharp/quickstart.md | 2 -- docs/modules/rust/quickstart.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/docs/modules/c-sharp/quickstart.md b/docs/modules/c-sharp/quickstart.md index e0fbf33e..22b3cc25 100644 --- a/docs/modules/c-sharp/quickstart.md +++ b/docs/modules/c-sharp/quickstart.md @@ -10,8 +10,6 @@ Each table is defined as a C# `class` annotated with `[SpacetimeDB.Table]`, wher By default, tables are **private**. This means that they are only readable by the table owner, and by server module code. The `[SpacetimeDB.Table(Public = true))]` annotation makes a table public. **Public** tables are readable by all users, but can still only be modified by your server module code. -_Coming soon: We plan to add much more robust access controls than just public or private tables. Stay tuned!_ - A reducer is a function which traverses and updates the database. Each reducer call runs in its own transaction, and its updates to the database are only committed if the reducer returns successfully. In C#, reducers are defined as functions annotated with `[SpacetimeDB.Reducer]`. If an exception is thrown, the reducer call fails, the database is not updated, and a failed message is reported to the client. ## Install SpacetimeDB diff --git a/docs/modules/rust/quickstart.md b/docs/modules/rust/quickstart.md index 057b3ad8..04b7d206 100644 --- a/docs/modules/rust/quickstart.md +++ b/docs/modules/rust/quickstart.md @@ -11,8 +11,6 @@ Each table is defined as a Rust struct annotated with `#[table(name = table_name By default, tables are **private**. This means that they are only readable by the table owner, and by server module code. The `#[table(name = table_name, public)]` macro makes a table public. **Public** tables are readable by all users but can still only be modified by your server module code. -_Coming soon: We plan to add much more robust access controls than just public or private. Stay tuned!_ - A reducer is a function that traverses and updates the database. Each reducer call runs in its own transaction, and its updates to the database are only committed if the reducer returns successfully. In Rust, reducers are defined as functions annotated with `#[reducer]`, and may return a `Result<()>`, with an `Err` return aborting the transaction. ## Install SpacetimeDB From 8932af1f003054189f7fb85eca88fc9f8912835d Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Mon, 3 Mar 2025 14:43:33 -0500 Subject: [PATCH 2/7] Remove hedging about supported module languages This kind of thing belongs in a roadmap, not anywhere else in our docs. --- docs/modules/index.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/modules/index.md b/docs/modules/index.md index 93b74cb3..78d60d9c 100644 --- a/docs/modules/index.md +++ b/docs/modules/index.md @@ -19,12 +19,3 @@ We have C# support available in experimental status. C# can be a good choice for - [C# Module Reference](/docs/modules/c-sharp) - [C# Module Quickstart Guide](/docs/modules/c-sharp/quickstart) - -### Coming Soon - -We have plans to support additional languages in the future. - -- Python -- Typescript -- C++ -- Lua From 838b5d1338de13168711967747a0a8546f54a1f4 Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Mon, 3 Mar 2025 15:02:03 -0500 Subject: [PATCH 3/7] Fix :fingers_crossed: formatting of link to scheduled reducers --- docs/index.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 9375f847..5f5ad6fb 100644 --- a/docs/index.md +++ b/docs/index.md @@ -209,14 +209,15 @@ public static void World(ReducerContext ctx) ``` ::: +:::server-rust While SpacetimeDB doesn't support nested transactions, -a reducer can [schedule another reducer] to run at an interval, +a reducer can [schedule another reducer](/docs/modules/rust#defining-scheduler-tables) to run at an interval, or at a specific time. -:::server-rust -[schedule another reducer]: /docs/modules/rust#defining-scheduler-tables ::: :::server-csharp -[schedule another reducer]: /docs/modules/c-sharp#scheduler-tables +While SpacetimeDB doesn't support nested transactions, +a reducer can [schedule another reducer](/docs/modules/c-sharp#scheduler-tables) to run at an interval, +or at a specific time. ::: ### Client From d6fabdee15b46dac902d7a904d625804b16a9545 Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Mon, 3 Mar 2025 15:03:43 -0500 Subject: [PATCH 4/7] Fix link --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 5f5ad6fb..864f7327 100644 --- a/docs/index.md +++ b/docs/index.md @@ -211,7 +211,7 @@ public static void World(ReducerContext ctx) :::server-rust While SpacetimeDB doesn't support nested transactions, -a reducer can [schedule another reducer](/docs/modules/rust#defining-scheduler-tables) to run at an interval, +a reducer can [schedule another reducer](https://docs.rs/spacetimedb/latest/spacetimedb/attr.reducer.html#scheduled-reducers) to run at an interval, or at a specific time. ::: :::server-csharp From 7b0a4bb74abc60b20a50a02ac74a6f2b492abe80 Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Mon, 3 Mar 2025 15:05:20 -0500 Subject: [PATCH 5/7] List module langs in alphabetical order Which also happens to be decreasing order of support and battle-tested-ness --- nav.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nav.ts b/nav.ts index 2de94ab3..611e1978 100644 --- a/nav.ts +++ b/nav.ts @@ -65,20 +65,20 @@ const nav: Nav = { section('Client SDK Languages'), page('Overview', 'sdks', 'sdks/index.md'), - page( - 'Typescript Quickstart', - 'sdks/typescript/quickstart', - 'sdks/typescript/quickstart.md' - ), - page('Typescript Reference', 'sdks/typescript', 'sdks/typescript/index.md'), - page('Rust Quickstart', 'sdks/rust/quickstart', 'sdks/rust/quickstart.md'), - page('Rust Reference', 'sdks/rust', 'sdks/rust/index.md'), page( 'C# Quickstart', 'sdks/c-sharp/quickstart', 'sdks/c-sharp/quickstart.md' ), page('C# Reference', 'sdks/c-sharp', 'sdks/c-sharp/index.md'), + page('Rust Quickstart', 'sdks/rust/quickstart', 'sdks/rust/quickstart.md'), + page('Rust Reference', 'sdks/rust', 'sdks/rust/index.md'), + page( + 'TypeScript Quickstart', + 'sdks/typescript/quickstart', + 'sdks/typescript/quickstart.md' + ), + page('TypeScript Reference', 'sdks/typescript', 'sdks/typescript/index.md'), section('WebAssembly ABI'), page('Module ABI Reference', 'webassembly-abi', 'webassembly-abi/index.md'), From 3ce6e98785a72c42a148c3d02432282b986ade15 Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Mon, 3 Mar 2025 15:07:51 -0500 Subject: [PATCH 6/7] Re-order various and pages in sidebar - Internals get their own section, and move down. - Appendix gets its own section, instead of joining "Subscriptions." - SQL and Subscriptions move up. --- docs/nav.js | 26 +++++++++++++------------- nav.ts | 20 ++++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/nav.js b/docs/nav.js index 85697a68..e69b3186 100644 --- a/docs/nav.js +++ b/docs/nav.js @@ -26,25 +26,25 @@ const nav = { page('C# Reference', 'modules/c-sharp', 'modules/c-sharp/index.md'), section('Client SDK Languages'), page('Overview', 'sdks', 'sdks/index.md'), - page('Typescript Quickstart', 'sdks/typescript/quickstart', 'sdks/typescript/quickstart.md'), - page('Typescript Reference', 'sdks/typescript', 'sdks/typescript/index.md'), - page('Rust Quickstart', 'sdks/rust/quickstart', 'sdks/rust/quickstart.md'), - page('Rust Reference', 'sdks/rust', 'sdks/rust/index.md'), page('C# Quickstart', 'sdks/c-sharp/quickstart', 'sdks/c-sharp/quickstart.md'), page('C# Reference', 'sdks/c-sharp', 'sdks/c-sharp/index.md'), - section('WebAssembly ABI'), - page('Module ABI Reference', 'webassembly-abi', 'webassembly-abi/index.md'), - section('HTTP API'), - page('HTTP', 'http', 'http/index.md'), - page('`/identity`', 'http/identity', 'http/identity.md'), - page('`/database`', 'http/database', 'http/database.md'), - section('Data Format'), - page('SATS-JSON', 'sats-json', 'sats-json.md'), - page('BSATN', 'bsatn', 'bsatn.md'), + page('Rust Quickstart', 'sdks/rust/quickstart', 'sdks/rust/quickstart.md'), + page('Rust Reference', 'sdks/rust', 'sdks/rust/index.md'), + page('TypeScript Quickstart', 'sdks/typescript/quickstart', 'sdks/typescript/quickstart.md'), + page('TypeScript Reference', 'sdks/typescript', 'sdks/typescript/index.md'), section('SQL'), page('SQL Reference', 'sql', 'sql/index.md'), section('Subscriptions'), page('Subscription Reference', 'subscriptions', 'subscriptions/index.md'), + section('HTTP API'), + page('HTTP', 'http', 'http/index.md'), + page('`/identity`', 'http/identity', 'http/identity.md'), + page('`/database`', 'http/database', 'http/database.md'), + section('Internals'), + page('Module ABI Reference', 'webassembly-abi', 'webassembly-abi/index.md'), + page('SATS-JSON Data Format', 'sats-json', 'sats-json.md'), + page('BSATN Data Format', 'bsatn', 'bsatn.md'), + section('Appendix'), page('Appendix', 'appendix', 'appendix.md'), ], }; diff --git a/nav.ts b/nav.ts index 611e1978..f9807c6f 100644 --- a/nav.ts +++ b/nav.ts @@ -80,23 +80,23 @@ const nav: Nav = { ), page('TypeScript Reference', 'sdks/typescript', 'sdks/typescript/index.md'), - section('WebAssembly ABI'), - page('Module ABI Reference', 'webassembly-abi', 'webassembly-abi/index.md'), + section('SQL'), + page('SQL Reference', 'sql', 'sql/index.md'), + + section('Subscriptions'), + page('Subscription Reference', 'subscriptions', 'subscriptions/index.md'), section('HTTP API'), page('HTTP', 'http', 'http/index.md'), page('`/identity`', 'http/identity', 'http/identity.md'), page('`/database`', 'http/database', 'http/database.md'), - section('Data Format'), - page('SATS-JSON', 'sats-json', 'sats-json.md'), - page('BSATN', 'bsatn', 'bsatn.md'), - - section('SQL'), - page('SQL Reference', 'sql', 'sql/index.md'), + section('Internals'), + page('Module ABI Reference', 'webassembly-abi', 'webassembly-abi/index.md'), + page('SATS-JSON Data Format', 'sats-json', 'sats-json.md'), + page('BSATN Data Format', 'bsatn', 'bsatn.md'), - section('Subscriptions'), - page('Subscription Reference', 'subscriptions', 'subscriptions/index.md'), + section('Appendix'), page('Appendix', 'appendix', 'appendix.md'), ], }; From b2e3992242e3f391da6e5943b520ebb92e0f1403 Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Mon, 3 Mar 2025 15:17:40 -0500 Subject: [PATCH 7/7] Remove outdated guidance about tokens We don't have "SpacetimeDB tokens" anymore, we just have regular OIDC JWTs. We don't need to offer any special guidance about JWT hygiene. --- docs/http/index.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/http/index.md b/docs/http/index.md index 64196fb6..4f0973dc 100644 --- a/docs/http/index.md +++ b/docs/http/index.md @@ -1,9 +1,5 @@ # SpacetimeDB HTTP Authorization -Rather than a password, each Spacetime identity is associated with a private token. These tokens are generated by SpacetimeDB when the corresponding identity is created, and cannot be changed. - -> Do not share your SpacetimeDB token with anyone, ever. - ### Generating identities and tokens SpacetimeDB can derive an identity from the `sub` and `iss` claims of any [OpenID Connect](https://openid.net/developers/how-connect-works/) compliant [JSON Web Token](https://jwt.io/).