Commit Graph

15 Commits

Author SHA1 Message Date
Phoebe Goldman ecc00cae40 Add reducer name to database log records (#3274)
# Description of Changes

Extends log records with a new field, `function`, which stores the name
of the reducer being executed when the log was produced. I have chosen
to name this field `function` rather than `reducer` because we will soon
be adding procedures, which are not reducers but will also be valid
values for this field.

While making this change, I noticed inconsistent values for injected
logs. Previously, we injected logs in three places, with different
values for the record fields:

1. `SystemLogger` (used when publishing and updating) set `filename:
Some("spacetimedb")` and `target: None`.
2. `log_reducer_error` (used for reducer error returns) set `filename:
None` and `target: Some(reducer)`, with `reducer` being the name of the
reducer.
3. `ModuleHost::inject_logs` (used for calls to nonexistent reducers and
calls with ill-typed arguments) set `filename: Some("external")` and
`target: None`.

With this change, I have decided that injected logs universally have
`filename: Some("__spacetimedb__")` and `target:
Some("__spacetimedb__")`. I have chosen the double-underscore convention
for reserved names to avoid confusion should a user name a source file
or reducer `spacetimedb`. I am not terribly attached to using
`spacetimedb` here, and would be happy to change to some other string,
like `internal` or `system`.

I have further decided that `log_reducer_error` and `inject_logs` both
have access to a sensible non-`None` value for `function` and so should
set it to the name of the reducer. The `target` field is not used for
this. Note that in cases where a client attempts to call a non-existent
reducer, the `function` field of the log record will be set to that
client-supplied non-existent reducer name.

# API and ABI breaking changes

Changes our log record format. This is at least backwards-compatible (as
in, newer consumers can read older logs) because the new field is
optional. I am unsure if it is forwards-compatible (as in, older
consumers reading newer logs) because I don't know if `serde_json` will
ignore unknown fields or will error.

# Expected complexity level and risk

1

# Testing

- [x] Manually ran `quickstart-chat` (modified to log messages and name
changes) and saw sensible output.
2025-09-23 16:01:26 +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 cbba2b29c1 Fix up GitHub files related to TypeScript SDK (#2943)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-16 19:32:04 +00:00
Adrien Figueiredo d7d5306018 Update quickstart-chat README.md (#2727)
Signed-off-by: Adrien Figueiredo <43353685+Trobyss@users.noreply.github.com>
2025-05-16 18:35:13 +00:00
Mario Montoya ee7970e752 Add .cargo/config.toml to spacetime init Rust project with default target to wasm (#2328) 2025-03-26 14:34:32 +00:00
Mario Montoya 04fd294627 Add missing LICENSE (#2319) 2025-02-28 14:32:59 +00:00
Mario Montoya 32e24b4095 Add README.md to all modules in SpacetimeDB/modules describing their usage (#2282) 2025-02-19 17:03:34 +00:00
Tyler Cloutier 85ffb2838c Fixed issues with the Rust module quickstart-chat README.md (#2154)
Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-01-24 18:24:14 +00:00
Noa 53758420ec Rust module API rework (#1660) 2024-09-27 20:09:36 +00:00
Tyler Cloutier 3530498b88 Switched table names to singular (#1684)
Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>
2024-09-11 11:11:51 -04:00
Noa 8daab8e20f Impl macro rework (#1314) 2024-09-09 23:30:31 +00:00
Zeke Foppa 4af892a122 [bfops/update-quickstart]: do thing (#1348)
Co-authored-by: Zeke Foppa <github.com/bfops>
2024-06-06 20:40:45 +00:00
Noa 37658aae7e Add rust-version to Cargo.toml (#802)
* Add rust-version to Cargo.toml

* Use workspace inheritance to make bumping the spacetime version easier
2024-02-07 20:02:05 +00:00
Mario Montoya 80a0a29704 Move cargo deps to the workspace (#172)
* Moving deps to workspace

* Merge
2023-08-11 15:24:31 -07:00
Phoebe Goldman 5cc11d8b06 Add quickstart-chat example module and client (#116)
This commit adds the `quickstart-chat` Rust module and client to the appropriate examples dirs.
2023-08-01 23:17:03 +02:00