Skip to content
🚀 This documentation is for unreal-orm 1.0.0 alpha which requires SurrealDB 2.0 alpha SDK. For the stable version, see npm.

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.

  • 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)

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
  • 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
  • Switch package manager from pnpm back to bun and update workspace configuration
  • Update test files with new update method syntax and surql templates
  • 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 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 removed, use update with mode: “merge” instead

    Before:

    await user.merge(db, { name: "Jane" });

    After:

    await user.update(db, { data: { name: "Jane" }, mode: "merge" });