A modern TypeScript toolkit for SurrealDB providing type-safe APIs, query builders, and development tools for building scalable applications with SurrealDB.
SurrealDBKit (sdbk) is a collection of TypeScript packages designed to make working with SurrealDB safer, more productive, and enjoyable:
- Type Safety — Full TypeScript support with compile-time validation
- Developer Experience — Intuitive APIs and helpful tooling
- Performance — Zero runtime overhead for type operations
- Modular — Use only what you need
⚠️ Early Development: This project is in active development. APIs may change and some packages are still in progress.
This monorepo contains the following packages:
Foundational type definitions and utilities for SurrealDBKit. Provides core types, building blocks, and shared abstractions used across rest of the packages.
Status: 🚧 In Development
Key Features:
- Entity and field type definitions
- Expression builders and identifiers
- Schema type system
- Runtime type guards
- Shared utilities for other packages
The following packages are planned and will build on top of @sdbk/core:
@sdbk/client— Type-safe client wrapper for SurrealDB (uses core types)@sdbk/query— Query builder with type inference (uses core expressions)@sdbk/migrate— Schema migration tools (uses core schema types)
All packages depend on @sdbk/core for shared type definitions and
utilities.
Check out the individual package documentation for usage examples:
- Core Usage — Core types and utilities
More examples and documentation will be added as packages are developed.
- TypeScript: >= 5.0.0
- Node.js: >= 18.0.0 (for development)
- Bun: >= 1.3.3 (recommended package manager)
This is a monorepo managed with Turbo and uses Bun as the package manager.
# Install Bun (if not already installed)
curl -fsSL https://bun.sh/install | bash# Clone the repository
git clone https://github.com/veskel01/sdbk.git
cd sdbk
# Install dependencies
bun install
# Build all packages
bun run build
# Run tests
bun run test
# Run linting
bun run lint
# Format code
bun run formatbun run build— Build all packagesbun run test— Run tests for all packagesbun run lint— Lint all packagesbun run format— Format all packagesbun run check:types— Type-check all packagesbun run clean:workspace— Clean build artifacts
sdbk/
├── packages/
│ └── core/ # Core type definitions
├── scripts/ # Build and utility scripts
└── turbo.json # Turbo configuration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project uses:
- Biome for formatting and linting
- Commitlint for commit message conventions
- Husky for git hooks
MIT © Jakub Andrzejewski (Veskel01)
See LICENSE file for details.