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.7

This release introduces the new insert() method with full SurrealDB INSERT statement support, and improves CLI reliability.

A new type-safe insert() method that provides full access to SurrealDB’s INSERT statement capabilities:

import { surql } from 'surrealdb';
// Single insert (explicit db)
const user = await User.insert(db, {
data: { name: 'John', email: 'john@example.com' },
});
// Bulk insert (implicit db)
const users = await User.insert({
data: [
{ name: 'John', email: 'john@example.com' },
{ name: 'Jane', email: 'jane@example.com' },
],
});
// With custom ID (must be RecordId type)
const user = await User.insert(db, {
data: { id: new RecordId('user', 'john'), name: 'John' },
});
// INSERT IGNORE - silently skip duplicates
await User.insert(db, {
data: { id: existingId, name: 'John' },
ignore: true,
});
// ON DUPLICATE KEY UPDATE with native SurrealQL
await User.insert(db, {
data: { id: existingId, name: 'John', visits: 0 },
onDuplicate: surql`visits += 1, lastSeen = time::now()`,
});
// Custom RETURN clause with native SurrealQL
const result = await User.insert(db, {
data: { name: 'John', email: 'john@example.com' },
return: surql`id, name, email`,
});
// Insert relation (auto-detected for relation tables)
await Follows.insert(db, {
data: { in: userId, out: targetId, createdAt: new Date() },
});
  • --no-count Option: Added --no-count flag to the view command to skip fetching table record counts, improving performance for large databases.
  • Version Detection: Improved CLI version detection to work correctly when installed globally from npm.
  • Version Check: Changed default npm dist-tag from alpha to latest for update checks.
  • Fixed CLI package.json not being included in published package, which caused version detection to fail.
PackageVersion
unreal-orm1.0.0-alpha.6 → 1.0.0-alpha.7
@unreal-orm/cli1.0.0-alpha.6 → 1.0.0-alpha.7