OxL Reference

error table-schema

error Standard: [§12.8]

What it means#

A table is a data type marked @table("name") with exactly one @pk field. @auto belongs on an integer @pk field, @index(.field, …) names fields of the type, and @pk, @auto, @index are only valid on a table. @encrypted (AES-256-GCM, [§13.3]) belongs on a str or bytes field (optional allowed) that is neither the @pk nor part of an @index: ciphertext cannot be compared or searched. The operations of Db (insert, find, db.User, from u in db.User …) need a type declared this way.

Example#

oxl✓ checked in CI
@table("notes")
data Note { text: str }                 // <- table-schema: no @pk

data Plain { id: i32 }
fn f(db: &Db) -> List<Plain> db {
  from p in db.Plain                    // <- table-schema: Plain is not a table
}
error
table-schema

How to fix#

oxl✓ checked in CI
@table("notes")
data Note { @pk @auto id: i64; text: str }

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides