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.

applySchema

applySchema(db, definables, method): Promise<void>

Defined in: schema/generator.ts:62

Generates and applies the full SurrealQL schema to a SurrealDB instance.

Surreal

The SurrealDB instance to apply the schema to.

Definable[]

An array of Definable entities (model classes and index definitions).

The method to use for schema application if a table already exists.

"IF NOT EXISTS" | "OVERWRITE" | "error"

Promise<void>