v1.0.0-alpha.1
This major release migrates Unreal ORM to SurrealDB JS SDK 2.0 alpha, adds comprehensive transaction support, and modernizes the API with enhanced type safety and query building capabilities.
✨ Features
Section titled “✨ Features”SurrealDB JS SDK 2.0 Alpha Migration
Section titled “SurrealDB JS SDK 2.0 Alpha Migration”- Upgrade to SurrealDB SDK 2.0.0-alpha.14 (and @surrealdb/node 2.3.4 for internal tests)
- Add BoundQuery and Expr type support for field options (assert, default, value, permissions)
- Implement surql template literals for type-safe SurrealQL expressions
- Add SurrealLike type for SurrealDB object compatibility (Surreal, Transaction, Session)
Client-side Transactions Support
Section titled “Client-side Transactions Support”Note: Client-side transactions are only supported in SurrealDB v3 (alpha).
- Implement SurrealLike parameter for all CRUD methods (create, select, update, delete)
- Create comprehensive transaction tests with feature flag checking
- Add feature flag checking for transaction compatibility
API Modernization
Section titled “API Modernization”- Refactor update methods with explicit modes: content, merge, replace, patch
- Add JsonPatchOperation support for patch mode updates
- Update build configuration to exclude tests from package output
Development Tooling
Section titled “Development Tooling”- Switch package manager from pnpm back to bun and update workspace configuration
- Update test files with new update method syntax and surql templates
🛠️ Breaking Changes
Section titled “🛠️ Breaking Changes”Field Options Type Changes
Section titled “Field Options Type Changes”-
Field options now use BoundQuery/Expr instead of strings
Before:
Field.string({assert: "$value CONTAINS '@'",default: "'unknown@example.com'",});After:
import { surql } from "surrealdb";Field.string({assert: surql`$value CONTAINS "@"`,default: surql`"unknown@example.com"`,});
Update Method Signature Changes
Section titled “Update Method Signature Changes”-
Update method signature now requires mode parameter and options object
Before:
await user.update(db, { name: "Jane" });await user.merge(db, { name: "Jane" });After:
await user.update(db, { data: { name: "Jane" }, mode: "merge" });await user.update(db, { data: { name: "Jane" }, mode: "content" });
Merge Method Removal
Section titled “Merge Method Removal”-
Merge method removed, use update with mode: “merge” instead
Before:
await user.merge(db, { name: "Jane" });After:
await user.update(db, { data: { name: "Jane" }, mode: "merge" });