Repository navigation
Closed
Labels
Description
Overview
Upgrade the entire NodeSpace stack from SurrealDB 2.x to SurrealDB 3.x, and fix the dev-proxy database initialization that fell out of sync with the Tauri app's refactored database management.
SurrealDB 3.0 was released February 2026 with significant performance improvements (8-22x faster graph queries), native AI agent memory support, and architectural changes. The current bun run dev:browser is broken due to SurrealDB SDK ^2.3 incompatibility with the installed SurrealDB 2.6.0 server — upgrading to 3.x resolves this and future-proofs the stack.
Problem Statement
Two issues converge here:
- Dev-proxy broken:
bun run dev:browserfails —schema.surqlexecution returns 400 (HTTP RPC session state issue between SDK ^2.3 and SurrealDB 2.6.0 server) - SurrealDB 2.x EOL: 3.0 is GA with breaking changes; staying on 2.x accumulates technical debt
Proposed Solution
Upgrade to SurrealDB 3.x across the entire stack and fix dev-proxy initialization.
Implementation Approach
Phase 1: Upgrade SurrealDB crate and server
- Update workspace
Cargo.toml:surrealdb = { version = "^3.0", ... } - Install SurrealDB 3.x server locally
- Review feature flags —
kv-rocksdbandprotocol-httpmay have changed
Phase 2: Migrate schema.surql
- MTREE → HNSW: Convert vector index from MTREE to HNSW
- Function renames:
::from::→::from_,::is::→::is_ <future>→ COMPUTED: Replace any future fields with computed fields- SEARCH ANALYZER → FULLTEXT ANALYZER: Update index definitions
- Review any
LETparameter declarations, optional chaining syntax changes
Phase 3: Fix Rust code for API changes
- Audit
SurrealStoremethods for any SDK API changes - Fix any query language changes in inline SurrealQL
- Test embedded (RocksDB) and HTTP connection modes
Phase 4: Fix dev-proxy initialization
- Align dev-proxy database init with Tauri app's
create_service_bundle()approach - Make database connection configurable (not hardcoded)
- Consider switching dev-proxy to embedded mode (eliminates HTTP session issues)
Phase 5: Verify end-to-end
bun run dev:tauriworks with SurrealDB 3.xbun run dev:browserworks with fixed dev-proxy- All Rust tests pass
- All frontend tests pass
Acceptance Criteria
- SurrealDB Rust crate upgraded to
^3.0 -
schema.surqlmigrated (MTREE→HNSW, function renames, etc.) - All SurrealQL queries in Rust code updated for 3.x syntax
-
bun run dev:browsersuccessfully starts and initializes schema -
bun run dev:tauriworks with SurrealDB 3.x - Dev-proxy database connection is configurable (not hardcoded)
- Rust tests pass (
bun run rust:test) - Frontend tests pass (
bun run test) - Code passes
bun run quality:fix
Technical Specifications
Reference Files
- Workspace Cargo.toml:
Cargo.toml—surrealdb = { version = "^2.3", features = ["kv-rocksdb", "protocol-http"] } - Schema:
packages/core/src/db/schema.surql— MTREE vector index, analyzers, full schema - SurrealStore:
packages/core/src/db/surreal_store.rs—new()(embedded) andnew_http()(HTTP) - Dev-proxy:
packages/dev-tools/src/bin/dev-proxy.rs— hardcodedHttpStore::new_http() - Tauri DB commands:
packages/desktop-app/src-tauri/src/commands/db.rs—create_service_bundle()
Breaking Changes Reference (2.x → 3.x)
- MTREE → HNSW for vector indexes
- Function renames:
::from::→::from_,::is::→::is_ <future>→ COMPUTED fields- SEARCH ANALYZER → FULLTEXT ANALYZER
- LET required for parameter declarations
- Like operators removed (
~,!~,?~,*~) - Optional chaining:
?→.? - array::range: args shifted from
(offset, count)to(start, end) - Migration docs: https://surrealdb.com/docs/surrealdb/installation/upgrading/migrating-data-to-3x
Version Targets
- SurrealDB server: 3.0.1 (latest stable)
- surrealdb Rust crate: ^3.0
Related Issues
- Task schema properties not settable in TaskNodeViewer for nested tasks #919 (task property persistence — requires working dev environment to test)
Activity
[-]Dev-proxy database initialization out of sync with Tauri app refactoring[/-][+]Upgrade to SurrealDB 3.x and fix dev-proxy database initialization[/+]malibio commentedon Mar 7, 2026
Baseline: Frontend 3681 passed (115 files), Rust 795 passed. Note: mcp::handlers::initialize integration tests hang indefinitely (pre-existing issue, excluded from baseline).
Upgrade SurrealDB 2.x to 3.x (closes #920)
Upgrade to SurrealDB 3.x and fix dev-proxy database initialization (#927