Skip to content
🚀 This documentation is for unreal-orm 1.0.0 alpha which requires SurrealDB 2.0 SDK. For use with version 1.x, see here.

v1.0.0-alpha.10

This release adds new field type definition methods and fixes schema generation compatibility with SurrealDB v3.

Define fields using SurrealQL’s native literal type syntax directly in your schema:

class Post extends Table.normal({
status: Field.literal("draft"), // or "published"
config: Field.literal({ mode: "strict", enabled: true }),
});

This generates proper SurrealQL field definitions like TYPE "draft" and TYPE { mode: "strict", enabled: true }.

Define fields with multiple possible types:

class Post extends Table.normal({
value: Field.union([Field.string(), Field.int()]),
status: Field.union([Field.literal("draft"), Field.literal("published")]),
});

Generates: TYPE string | int and TYPE "draft" | "published".

New documentation guide for integrating AI assistance into your development workflow with Unreal ORM.

The docs now automatically generate llms.txt and llms-full.txt context files for improved AI tool compatibility.

  • Upgraded surrealdb from ^2.0.0 to ^2.0.3
  • Upgraded @surrealdb/node from ^3.0.1 to ^3.0.3

Fixed schema generation to place the FLEXIBLE keyword before the TYPE clause. SurrealDB v3 has stricter parsing rules, and this ordering is required:

-- Before (broken in SurrealDB v3):
DEFINE FIELD data ON TABLE posts TYPE object FLEXIBLE;
-- After (correct):
DEFINE FIELD data ON TABLE posts FLEXIBLE TYPE object;