+The generated schema uses `SCHEMAFULL` tables by default. Each field is typed from the BetterAuth schema: required fields take a concrete type (`string`, `datetime`, `bool`, and so on), optional fields use `option<T | null>` so they accept a typed value, a stored `NULL`, or a missing value, and object fields are marked `FLEXIBLE` so they hold arbitrary keys. Fields declared by Better Auth with `references: { field: "id" }` are emitted as SurrealDB `record<table>` fields, for example `session.userId` becomes `record<user>`. `DEFINE INDEX` statements are emitted for unique fields and for fields BetterAuth marks as indexed. Every statement uses `IF NOT EXISTS`, so the file is safe to reapply.
0 commit comments