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.

extractIndexFromDefinition

extractIndexFromDefinition(indexDef): object

Defined in: schema/ast/extractor.ts:256

Extracts an IndexAST from a runtime index definition.

IndexDefinition

The index definition to extract from

object

Object containing the IndexAST and associated table name

index: IndexAST

tableName: string

const { index, tableName } = extractIndexFromDefinition(emailIndex);
// { index: { name: "email_idx", columns: ["email"], unique: true }, tableName: "user" }