Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills/concepts/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SpacetimeDB is a relational database that is also a server. It lets you upload a
## Critical Rules

1. **Reducers are transactional.** They do not return data to callers. Use subscriptions to read data.
2. **Reducers must be deterministic.** No filesystem, network, timers, or random. All state must come from tables.
2. **Reducers must be deterministic.** Do not use filesystem, network, external clocks, or external random sources in reducers. Use `ReducerContext` for SpacetimeDB-provided timestamp and deterministic random values.
3. **Read data via tables/subscriptions**, not reducer return values. Clients get data through subscribed queries.
4. **Auto-increment IDs are not sequential.** Gaps are normal, do not use for ordering. Use timestamps or explicit sequence columns.
5. **`ctx.sender` is the authenticated principal.** Never trust identity passed as arguments.
Expand Down
2 changes: 1 addition & 1 deletion skills/csharp-server/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public partial struct TickTimer
[SpacetimeDB.Reducer]
public static void Tick(ReducerContext ctx, TickTimer timer)
{
// timer row is auto-deleted after this reducer runs
// One-shot rows auto-delete after this runs; interval rows remain.
}

// One-time: fires once at a specific time
Expand Down
2 changes: 1 addition & 1 deletion skills/rust-server/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub struct TickTimer {

#[spacetimedb::reducer]
pub fn tick(ctx: &ReducerContext, timer: TickTimer) {
// timer row is auto-deleted after this reducer runs
// One-shot rows auto-delete after this runs; interval rows remain.
}

// One-time: fires once at a specific time
Expand Down
2 changes: 1 addition & 1 deletion skills/typescript-server/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const tickTimer = table({

export const tick = spacetimedb.reducer(
{ timer: tickTimer.rowType },
(ctx, { timer }) => { /* timer row auto-deleted after this runs */ }
(ctx, { timer }) => { /* one-shot rows auto-delete after this runs; interval rows remain */ }
);

// One-time: ScheduleAt.time(ctx.timestamp.microsSinceUnixEpoch + delayMicros)
Expand Down
Loading