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.

generateSurqlFromAST

generateSurqlFromAST(schema, method): string

Defined in: schema/ast/generator.ts:242

Generates a complete SurrealQL schema from SchemaAST.

SchemaAST

The schema AST

SchemaApplicationMethod = "error"

Schema application method

string

Complete SurrealQL schema as a string

const schema = extractSchemaFromDefinables([User, Post]);
const sql = generateSurqlFromAST(schema, "OVERWRITE");
await db.query(sql);