Conversation
Implement the SQL service as specified in Appendix J, providing relational database capabilities per-space via SQLite. Core SQL module (tinycloud-core/src/sql/): - types: SqlRequest/SqlResponse/SqlValue/SqlError with serde support - caveats: SqlCaveats for table/column/statement/read-only restrictions - parser: Pre-execution SQL validation via sqlparser-rs (blocks ATTACH/DETACH) - authorizer: SQLite authorizer callback for defense-in-depth enforcement - storage: Hybrid in-memory/file storage with WAL mode and backup API promotion - database: Actor-per-database pattern via spawn_blocking + mpsc channels - service: SqlService registry with DashMap, lazy actor spawning, idle timeout Server integration: - Route handler detects sql service capabilities and dispatches to SQL path - JSON request/response for query/execute/batch, binary for export - SqlError mapped to appropriate HTTP status codes - SqlStorageConfig added to server configuration - sql_database migration for metadata tracking - "sql" added to /version features Dependencies: rusqlite 0.31 (bundled), sqlparser 0.44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tinycloud.sql/*) as specified in Appendix J, providing per-space relational databases via SQLiteArchitecture
spawn_blockingtask with mpsc channels for serialized accessSqlCaveatsextracted from UCAN facts enable table/column/statement/read-only restrictionsNew Dependencies
rusqlite 0.31(bundled SQLite compilation)sqlparser 0.44(SQL AST parsing)Test plan
cargo checkpassescargo clippy -- -D warningspassescargo testpasses (all existing tests still pass)