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.

extractIndexFromDefinition

extractIndexFromDefinition(indexDef): object

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

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" }