Skip to content

Implement async Database API (breaking change) #6

@michaeloboyle

Description

@michaeloboyle

Breaking Change: Async Database API

Convert all Database methods from sync to async for browser compatibility.

Rationale

  • Browser WASM requires async (no sync file I/O)
  • Universal API works everywhere
  • No breaking changes concern (pre-v1.0, zero adoption)

Scope

  • Database.create() - Factory method
  • createNode(), createEdge() - CRUD ops
  • nodes(), edges() - Query builders
  • transaction() - Transaction handling
  • All NodeQuery methods
  • All TraversalQuery methods
  • Update all tests (234+ tests)
  • Update all examples
  • Update all documentation

Migration Example

// Before (v0.x - sync)
const db = new GraphDatabase('./graph.db');
const node = db.createNode('Job', { title: 'Engineer' });

// After (v1.0 - async)
const db = await GraphDatabase.create('./graph.db');
const node = await db.createNode('Job', { title: 'Engineer' });

AgentDB Info

Pattern: async-api-migration
Complexity: High (4-6 hours estimated)
Recommended Approach: SPARC multi-agent swarm
Agents Needed: specification, architect, coder (2x parallel), tester, reviewer

References

  • Adapter pattern: experiments/browser-poc/
  • NodeAdapter: sync wrapper for better-sqlite3
  • BrowserAdapter: native async for wa-sqlite

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeBreaking API changesbrowser-supportBrowser compatibility and testingsparc-readyComplex task requiring SPARC orchestration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions