extractIndexFromDefinition
extractIndexFromDefinition(
indexDef):object
Defined in: schema/ast/extractor.ts:251
Extracts an IndexAST from a runtime index definition.
Parameters
Section titled “Parameters”indexDef
Section titled “indexDef”IndexDefinition
The index definition to extract from
Returns
Section titled “Returns”object
Object containing the IndexAST and associated table name
index:
IndexAST
tableName
Section titled “tableName”tableName:
string
Example
Section titled “Example”const { index, tableName } = extractIndexFromDefinition(emailIndex);// { index: { name: "email_idx", columns: ["email"], unique: true }, tableName: "user" }