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.

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);