-
Notifications
You must be signed in to change notification settings - Fork 671
Further misc docs changes #4029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
In StrictMode, React unmounts and remounts components synchronously to detect side effects. The previous cleanup would disconnect immediately, killing the in-flight WebSocket connection. Fix: defer disconnect with setTimeout(..., 0). Since StrictMode remounts happen in the same JavaScript task, the remount cancels the pending timeout, preserving the connection. Real unmounts proceed normally since no remount occurs to cancel the timeout.
The error now hints that the table may be private, helping users diagnose visibility issues.
For consistency with other CLI commands (publish, call, logs, sql), the database name is now a positional argument instead of a flag. The --database flag is deprecated but still works with a warning.
Add "Understand tables and reducers" step showing template code and "Test with the CLI" step demonstrating spacetime call, sql, and logs commands with example output. Also simplify basic-c-sharp template to match Rust/TypeScript templates (person table with name field only).
- Split "Column Types and Constraints" into three pages: - Column Types: primitive, structured, and special types - Primary Keys: rules, implications, multi-column workarounds - Constraints: unique, auto-increment, default values - Add table styling with border radius and row separators - Add Check component for green checkmark badges in tables - Update functions comparison table to use Check component - Add note about view transaction isolation
Schedule tables store schedules; the reducers they trigger are "scheduled reducers". This naming clarifies that the table itself is a schedule, not something that is scheduled. - Rename file and update slug from /tables/scheduled-tables to /tables/schedule-tables - Update all references throughout docs - Add note explaining why code uses "scheduled" (refers to the scheduled reducer)
- Explain tables as SpacetimeDB's fundamental unit (like files in Unix) - Describe self-describing nature via system tables (st_table, st_column) - Connect to data-oriented design philosophy - Recommend table decomposition by access pattern - Provide concrete game schema example showing decomposed approach - Fix stale link to schedule-tables
…ucture - Add section explaining how tables separate logical queries from physical representation - Explain how indexes improve performance without changing queries - Update Table Visibility to mention view functions and link to access permissions - Add brief Constraints section linking to primary keys and constraints pages - Add brief Schedule Tables section linking to schedule tables page - Remove em dashes throughout
- Combine primitive, structured, and special types into single table per language - Add "Representing Collections" section on Vec/Array vs table tradeoffs - Add "Binary Data and Files" section on storing blobs with Vec<u8> - Add "Type Performance" section covering smaller types, fixed-size types, and column ordering for alignment/padding optimization
Column Types: - Rename "Structured" category to "Composite" for clarity - Add complete example showing all type categories in one table Indexes: - Add "When to Use Indexes" section with practical guidance - Document B-tree index type and its capabilities - Cover single-column indexes with field-level and table-level syntax - Explain multi-column indexes with prefix matching semantics - Add comprehensive query examples: equality, range, and multi-column - Document deletion via indexes - Include index design guidelines for column selection and ordering - Fix TypeScript examples to use correct Range class with Bound objects
- /tables/columns -> /tables/column-types (page was renamed) - /tables/scheduled-tables -> /tables/schedule-tables (page was renamed)
a1ba53a to
acd1d84
Compare
…ult values - Create dedicated auto-increment page with sequence semantics - Document trigger value (zero activates auto-increment) - Explain sequence parameters, wrapping, and crash recovery - Add concurrency section: gaps can occur, no sequential guarantee - Include manual counter pattern for strict sequential numbering - Merge primary keys into constraints page - Primary key is technically a constraint - Consolidate all constraint documentation in one place - Create dedicated default values page - Extract from constraints page (not actually a constraint) - Document schema evolution use case - Update all cross-references and Next Steps sections
- Document direct indexes as O(1) alternative to B-tree for dense integer keys - Add index types comparison table (B-tree vs Direct) - Expand access permissions with public/private table visibility - Add view examples for filtering rows by caller and hiding sensitive columns - All view examples use index lookups (not table scans) per performance requirements
Cover all CRUD operations with code samples in all three languages: insert, find, filter, update, delete, iter, and count.
…and examples - Explain why anonymous views scale better (shared materialization) - Add per-user view example (my_player) - Add shared leaderboard example - Add region-based design pattern showing how to structure data for sharing
- Note that Rust requires importing the Table trait for methods like try_insert - Expand ViewContext vs AnonymousViewContext with performance guidance - Add examples: per-user view, shared leaderboard, region-based design
- Add TypeScript examples throughout subscriptions documentation - Fix tab groupId from "server-language" to "client-language" for client SDK docs - Fix reducer-context groupId to "server-language" for consistency - Strengthen RLS deprecation warning, recommend views instead
jdetter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are a lot of small problems here, I'm leaving this review for now but I'd like to have the opportunity to review more tomorrow. I tried to at least compile every rust example, I will do C# and typescript tomorrow if that would be useful.
Please take special note for the changes in templates/basic-c-sharp/spacetimedb/Lib.cs as it does not build.
docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00400-part-3.md
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00300-tables/00230-auto-increment.md
Outdated
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00300-tables/00230-auto-increment.md
Outdated
Show resolved
Hide resolved
jdetter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok substantially less issues here - this is a lot better. I found a final few things that are easy to fix.
I think this is ready to go after one more batch of suggested changes @cloutiertyler
Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
|
/update-llm-benchmark |
- Add ci-comment command to generate PR comment markdown locally - Add tab filtering for language-specific context (server-language, client-language) - Improve analyze command with language-grouped output and typed failure extraction - Update GitHub workflow to use generated comment file and show diffs vs master - Add ScoreDetails.failure_reason() for typed extraction of failure info - Document context construction and tab filtering in DEVELOP.md
docs/docs/00200-core-concepts/00300-tables/00200-column-types.md
Outdated
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00300-tables/00200-column-types.md
Outdated
Show resolved
Hide resolved
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com> Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
|
/update-llm-benchmark |
Added missing C# tab examples for: - Filtering Rows by Caller (Message table, MyMessages view) - Hiding Sensitive Columns (UserAccount table, PublicUserProfile type, MyProfile view) - Combining Both Techniques (Employee table, TeamMember type, MyTeam view)
jdetter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last little review on this
docs/docs/00200-core-concepts/00300-tables/00400-access-permissions.md
Outdated
Show resolved
Hide resolved
- Removed the leaderboard example that used .iter() to scan all rows - Added "Why Views Cannot Use .iter()" section explaining: - Views are black boxes that can't be incrementally evaluated - Full table scans create pessimistic read sets requiring full re-evaluation - Index lookups enable targeted invalidation - SQL subscriptions can scan because the query engine can compute incremental updates - The tradeoff is acceptable for indexed access patterns
Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Changed from .iter() to filtering on a btree-indexed score column to demonstrate how to get high scorers without full table scans.
|
/update-llm-benchmark |
All 21 C# task prompts now use PascalCase table names matching their corresponding golden answers. This fixes the mismatch where prompts used lowercase (e.g., "users", "primitives") but golden answers used PascalCase (e.g., "User", "Primitive").
|
/update-llm-benchmark |
Anthropic:
- Add anthropic-beta: prompt-caching-2024-07-31 header
- Add cache_control: {"type": "ephemeral"} to static docs prefix
- This reduces costs by ~90% for cached tokens after the first request
OpenAI:
- Added documentation noting automatic caching behavior
- OpenAI's Responses API caches repeated prefixes automatically
- Static docs prefix placed first to maximize cache hits
|
/update-llm-benchmark |
Description of Changes
Major documentation overhaul focusing on tables, column types, and indexes.
Quickstart Guides:
--databaseargument)Tables Documentation:
Column Types:
Indexes:
Rangeclass syntaxStyling:
API and ABI breaking changes
None. Documentation only.
Expected complexity level and risk
1 - Documentation changes only, no code changes.
Testing