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.

parseIndexDefinition

parseIndexDefinition(ql): IndexAST

Defined in: schema/ast/parser.ts:215

Parses a DEFINE INDEX statement into an IndexAST.

string

The raw SurrealQL DEFINE INDEX statement

IndexAST

Complete IndexAST

const index = parseIndexDefinition("DEFINE INDEX email_idx ON TABLE user FIELDS email UNIQUE");
// { name: "email_idx", columns: ["email"], unique: true }