Commit Graph

217 Commits

Author SHA1 Message Date
Kim Altintop f394de32d9 Confirmed reads (#3133)
# Description of Changes

Implements [subscribing to durable
commits](https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1594).

The setting works on a per-connection level, and essentially just delays
sending transaction updates until the transaction is reported as durable
by the database.

For connectionless SQL operations, the setting works per-request. No SQL
syntax is provided by this patch to toggle the configuration.

After some deliberation, I opted to obtain the offset when a transaction
commits (as opposed to when it starts). This creates some mild
inconvenience, because we prevent the transaction from committing until
the corresponding subscription updates are enqueued.
The strategy is, however, more correct should we ever support weaker
isolation levels, and it is easier to document.

Follow-ups include:

- Provide SQL syntax (`SET synchronous_commit = ON` or something)
- C# and TypeScript SDKs
- Reference docs?
 

# API and ABI breaking changes

Not breaking, but adds a parameter to the subscribe and sql endpoints.


# Expected complexity level and risk

4

To the author's understanding, ordering of outbound messages is not
changed by this patch, even if there are messages that don't have a
transaction offset (such as error messages). I.e. while waiting for the
transaction offset of a message to become durable, no message enqueued
after that message will be delivered. This may not be desirable in some
cases.

The patch may contain concurrency bugs, e.g. awaiting futures that may
never resolve.


# Testing

- [x] Implemented a new test in the `module_subscription_actor` module
- [x] Added unit tests for the core logic in `ClientConnectionReceiver` 

It would be desirable to also have integration-level tests, but I'm
currently unsure how to write those without being able to control if and
when the database reports an offset as durable.

---------

Signed-off-by: Kim Altintop <kim@eagain.io>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
2025-09-08 17:51:04 +00:00
Zeke Foppa adbfe3b0bd Tidy up CLI reference generation flow (#3226)
# Description of Changes

Some minor cleanups in the flow for regenerating the CLI reference.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Existing CI passes

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-09-04 20:08:24 +00:00
Tyler Cloutier 413c8cbf3c Unifies TypeScript packages and command names (#3195)
# Description of Changes

This PR:
 - standardizes the prettier config across all TypeScript projects
 - adds a root level package.json
 - standardizes all `pnpm` commands to be the same
 - updates documentation accordingly
- adds some additional typescript testing for serialization and
deserialization
 
**IMPORTANT!** Once this PR merges we will need to change the
`compile-and-test` required check to `build-and-test`

# API and ABI breaking changes

No breaking changes.

# Expected complexity level and risk

2 - It in principle doesn't change any code, but could affect deploy
processes.

# Testing

- [x] Just the automated testing that we had previously
- [x] I added additional automated tests

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-09-04 02:23:29 +00:00
rekhoff 86c6d3b009 Updated C# quickstart-chat to pattern match variable assignment (#3173)
# Description of Changes

To address user issue
https://github.com/clockworklabs/SpacetimeDB/issues/2647 , the C#
implementation of quickstart-chat files and documentation have been
updated to pattern match the variable assignment of User.

This has the benefit of the variables never being perceived by the
analyzers as a nullable types.

# API and ABI breaking changes

Not API breaking

# Expected complexity level and risk

1

# Testing

- [X] Tested updated module code locally, following instructions from
the documentation.

Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2025-08-26 21:19:01 +00:00
Zeke Foppa b9d30991f1 Fix remaining LICENSE files (#3193)
# Description of Changes

Apparently, I missed several license files in #3002. I'm not sure what
method I was using to find them, but apparently it was insufficient.

**This replaces all empty `LICENSE` files with an explicit (symlink to)
BSL license, and all apache licenses with symlinks to the root apache
license.** This PR does not intentionally change any license terms, so
if you see one that changed, **it's a mistake**.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

```bash
$ find . -name '*LICENSE*' -type f | grep -v '\.meta$'
./crates/sqltest/standards/LICENSE # this one is an external library that we are not allowed to re-license
./LICENSE.txt # this is the root license
```

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-22 19:36:47 +00:00
Zeke Foppa 5eac1b3b0a Add workflow preview diagram in index (#3139)
# Description of Changes

Migrate https://github.com/clockworklabs/spacetime-docs/pull/328 since
we are merging that repo into this one.

# API and ABI breaking changes

None. Docs-only change.

# Expected complexity level and risk

1

# Testing

None

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2025-08-18 22:04:00 +00:00
Zeke Foppa f68369d579 Added RLS to llms.txt (#3134)
# Description of Changes

Migrating https://github.com/clockworklabs/spacetime-docs/pull/321. It
was already approved there, but I guess never merged.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

None

---------

Co-authored-by: = <cloutiertyler@gmail.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2025-08-15 17:31:30 +00:00
Rot4tion 1733145954 Update outdated the demo Blackholio source url (#3150)
# Description of Changes

Updated outdated repository link in documentation from
`https://github.com/ClockworkLabs/tree/master/demo/Blackholio`
to

`https://github.com/clockworklabs/SpacetimeDB/tree/master/demo/Blackholio`
to reflect the current location of the Blackholio demo.

# API and ABI breaking changes

None.

# Expected complexity level and risk

Complexity level: **1** (trivial change)
This is a simple documentation update with no impact on code execution,
APIs, or ABIs.

# Testing

Verified that the new link is valid and accessible.
No additional testing required.

* [ ] Reviewer can confirm that the new link resolves correctly.
2025-08-11 15:08:25 +00:00
Zeke Foppa d802230334 Add "How to compile" section to Rust quickstart (#3136)
# Description of Changes

Migrate https://github.com/clockworklabs/spacetime-docs/pull/45.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

None

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-08 15:50:22 +00:00
Zeke Foppa b53f998941 Add repo migration notice workflows (#3127)
# Description of Changes

Added a repo migration notice workflow to each repository that we've
merged into SpacetimeDB.

These need to be mirrored back to the actual repos with a process like:
```bash
git subtree split --prefix=sdks/typescript -b release/typescript
git push -f git@github.com:clockworklabs/spacetimedb-typescript-sdk.git release/typescript:main
git branch -D release/typescript
```

Once they're migrated there, the bot will automatically comment on any
PR or issue opened in those repos.

# API and ABI breaking changes

None. CI-only changes.

# Expected complexity level and risk

2

# Testing

- [x] In a demo repo, it properly commented and closed a PR:
https://github.com/clockworklabs/github-tooling-test/pull/42
- [x] In a demo repo, it properly commented and closed an issue:
https://github.com/clockworklabs/github-tooling-test/issues/43

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-05 20:30:42 +00:00
Zeke Foppa 3a2f118634 Docs - Fix incorrect reference to Rust client SDK (#3124)
# Description of Changes

Fixes https://github.com/clockworklabs/SpacetimeDB/issues/3073

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

None

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-05 17:19:08 +00:00
Zeke Foppa 797eea8575 CI - Monorepo tweaks (#3000)
# Description of Changes

Some small CI tweaks related to the monorepo merge.

Once we've landed these, I think we can make most of the new checks
required.

# API and ABI breaking changes

CI only changes

# Expected complexity level and risk

1

# Testing

None, just tweaked names.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-29 17:58:03 +00:00
Zeke Foppa 136d5dda82 Update docs to point to SpacetimeDB monorepo (#2989)
# Description of Changes

We recently merged several repos into the SpacetimeDB repo. This PR
update the docs accordingly.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

None, just docs

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-28 15:59:43 +00:00
rekhoff 36f7ca2583 Adding reject-client-connections doc. (#2973)
# Description of Changes

This originally was a PR in the Docs repo:
https://github.com/clockworklabs/spacetime-docs/pull/352

This is the work portion of
https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1700

This adds a "How To Reject Client Connections" guide in both Rust and C#
using the language toggle functionality.

Testing:
- [X] Validated code behavior presented in guide resulted in described
behavior.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-07-25 18:07:31 +00:00
Zeke Foppa 6c9aebdbf3 Docs CI - Check that nav.js matches the .md files list (#2984)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-25 16:54:25 +00:00
Zeke Foppa 7afa0b4cce Docs import - Update GitHub-related files (#2949)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-17 16:24:09 +00:00
Zeke Foppa 5fe544a7d2 [bfops/import-docs]: Merge remote-tracking branch 'temp-docs/master' into bfops/import-docs 2025-07-16 21:21:34 -07:00
Kim Altintop eecc591ef1 Document WebSocket config for standalone (#353) 2025-07-16 21:05:38 +02:00
Phoebe Goldman 4c470f0579 Fix example that was still rust-ey in C# ref (#333)
* Fix example that was still rust-ey in C# ref

This must have gotten missed when porting the Rust ref over to C#.

* Read `.Value`

Co-authored-by: james gilles <jameshgilles@gmail.com>

---------

Co-authored-by: james gilles <jameshgilles@gmail.com>
2025-07-14 19:34:02 +00:00
Carlos Cobo 0584e75081 Fix TypeScript Quickstart wrong import (#349) 2025-06-03 09:31:50 -07:00
Wes Sleeman 313fdd22a3 RLS Documentation - Invalid SQL Query (#351)
Added missing required column identifier to simple query RLS documentation examples.
2025-05-22 13:49:49 +00:00
Sahil Dawka f3a7e8cc93 Remove double code-lang buttons (#347)
Nested the lang specific text into the overall codeblock instead of duplicating below.
2025-05-16 10:00:39 -07:00
Tamaro Skaljic 5d4cce6c49 Document sql reserved identifiers #266 (#302)
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-05-16 09:42:10 -07:00
João Saldanha Streibel 7528afe3c6 Fixed DB_NAME name mismatch (#346)
The doc text suggested DB_NAME for variable name, but code sample used DBNAME.

Changed all to DB_NAME, for consistency.

Thanks @gefjon on Issue #345.
2025-05-09 08:40:49 -04:00
João Saldanha Streibel e8a0dfddb0 Fixed typo in quickstart.md (#344) 2025-05-07 22:21:57 +01:00
Chip be1c2e100b Stronger wording to direct users to working unity versions (#334)
* Some wording changes to the required unity versions

we've had a few people utilize Unity 2021.2, but have a lot of errors/issues in the console. It's best to direct users to 2022.3.32f1 onward.

* Removed recommended verbiage
2025-05-06 15:23:27 -04:00
Tyler Cloutier b230a92a4c Now noting that StdbModule.csproj is important (#327)
Update index.md
2025-05-06 18:34:52 +01:00
Tyler Cloutier ed1808de3e Fixed a typo with acquainted (#322) 2025-05-06 18:25:08 +01:00
Tyler Cloutier 51883b12d7 Add directions for navigating to the dashboard (#326)
Update maincloud.md
2025-05-06 18:23:58 +01:00
John Detter f469676ade Fix blocking publish route (#338)
* Fix blocking publish route

* Added common routes

* Default to open - which was the previous functionality

* Update spacetimedb-standalone.md

* Update spacetimedb-standalone.md

* Updated with support for the typescript SDK

* Updated with known good subscribe route

* Updated doc text

* Clarified comment

* nit
2025-05-06 01:19:13 +01:00
Phoebe Goldman 6b4433ba79 Add "Subscription Semantics" page (#278)
We've gotten several questions in the public Discord
about the semantics of subscriptions in the SDKs.
I did a brain-dump about them, Tyler fed it into ChatGPT,
I touched up the result a bit, and here it is.
Some day we probably want to rewrite this to read less like AI slop.
But for now it's probably fine.
2025-05-05 13:25:57 +00:00
Robin Curbelo 694bc483d9 fix typo (#339) 2025-05-02 17:01:01 +00:00
Zeke Foppa ec37594e79 Fix link checking (#340)
* [bfops/check-links]: fix link checker

* [bfops/check-links]: fix

* [bfops/check-links]: fix broken links

* [bfops/check-links]: fix logic

* [bfops/check-links]: fix site links

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-05-01 15:26:02 -07:00
Chip 0cca3d98df updated dotnet add package (#337)
* updated dotnet add package

* additional reference to spacetimedbsdk dotnet package
2025-04-30 17:13:47 +01:00
Tamaro Skaljic 53e0b77f8b fix wrong quote usage and copy the "start the server" section from c# quickstart to rust quickstart #41 (#310)
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-04-29 10:49:53 -07:00
Chip 45a83c9b5a Correcting Reducer Callback Information in llms.md (#335)
* update reducer callback with correct info

* remove flavor text - not needed
2025-04-28 09:42:46 -04:00
Jeffrey Dallatezza 8508bbf446 Subscribe to all queries together in the ts quickstart. (#297) 2025-04-25 17:20:46 +00:00
Zeke Foppa 3d1fa97c63 CI - Expand CI-triggering events (#332)
* [bfops/ci-on-master]: Run CI on `master` commits

* [bfops/ci-on-master]: tweak

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-24 15:03:41 -07:00
Aaron Matthis a70339488c rls docs self-join example: undefined 'u' sql name -> 'a' (#330)
fix: undefined 'u' sql name -> 'a'
2025-04-23 17:41:36 +00:00
Loki McKay b27ed08baa Fix typo in quickstart.md (#331) 2025-04-23 13:49:25 +00:00
Jeffrey Dallatezza 81ef6a0adc Update docs links to remove index.md (#316)
These links are broken in the live docs, but removing index.md from the links fixes them for me.

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-04-21 17:44:41 +00:00
Tamaro Skaljic 4b48e003b1 fix links from rls docs to sql docs on website (#323)
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-04-21 09:35:53 -07:00
torjusik 11aeb5efea Fixed typo (#320)
multple -> multiple
2025-04-21 09:26:15 -07:00
Zeke Foppa c0334498de CI - Check the CLI docs (#318)
* [bfops/cli-ci]: CI - Check the CLI docs

* [bfops/cli-ci]: fix

* [bfops/cli-ci]: fix permission warnings

* [bfops/cli-ci]: review

* [bfops/cli-ci]: review

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-17 10:57:11 -07:00
Zeke Foppa c7f89fa82d Revert CLI reference to match what the CLI outputs (#317)
[bfops/revert-docs]: revert

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-17 10:36:54 -07:00
Tamaro Skaljic 66561205f5 rename http/index.md to "Authorization" #235 (#308) 2025-04-16 13:48:59 -07:00
Tamaro Skaljic b1b4724a04 Remove experimental label of C# #246 (#305) 2025-04-16 16:10:08 -04:00
Tamaro Skaljic 31c9ee5116 Rename module to database where appropriate (#277)
* clients connect to databases, not modules

* the name is for the database, not the module

* reducers are exposed by databases, not modules

* don't name clients "modules" too

* Modules have no state, the database has it

* more database instead of client connection

* databases are hosted, not modules

* users interact with databases, not modules

* fix typo

* Apply suggestions from code review

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>

---------

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2025-04-16 16:09:48 -04:00
Tamaro Skaljic 1cb61db0a5 remove specific programming lang for server module code (#312)
in unity tutorial text. There was confusion: https://discord.com/channels/1037340874172014652/1037343189339742298/1361811650713227285
2025-04-16 10:22:22 -07:00
Phoebe Goldman e7cb1ee00f Add docs for indexable types to C# (#285)
Includes references to changes made by
https://github.com/clockworklabs/SpacetimeDB/pull/2506 ,
which as of writing has not merged.
We should not push this commit live until after that PR is released.
2025-04-16 09:58:40 -04:00