moonbitstack/moonorm/schema does not have a README file
pub(all) struct Column {
name : String
col_type : ColumnType
primary_key : Bool
autoincrement : Bool
nullable : Bool
unique : Bool
default : String?
checks : Array[String]
references : (String, String)?
on_delete : String?
on_update : String?
}pub(all) enum ColumnType {
IntType
TextType
RealType
BlobType
BoolType
VarcharType(Int)
NumericType
DateTimeType
DateType
TimeType
UuidType
JsonType
} derive(Eq)Model::from_fields(
"hero",
[
field("id", IntType, primary_key=true, h => Int(h.id)),
field("name", TextType, nullable=false, h => Text(h.name)),
],
r => { id: r.int(0), name: r.text(1) },
)fn column(name : String, col_type : ColumnType, primary_key? : Bool, autoincrement? : Bool, nullable? : Bool, unique? : Bool, default? : String, checks? : Array[String], references? : (String, String), on_delete? : String, on_update? : String) -> Columnfn[T] field(name : String, col_type : ColumnType, encode : (T) -> Value, primary_key? : Bool, autoincrement? : Bool, nullable? : Bool, unique? : Bool, default? : String, checks? : Array[String], references? : (String, String), on_delete? : String, on_update? : String) -> Field[T]fn[S, T] many_to_many(target : Model[T], junction~ : String, source_fk~ : String, target_fk~ : String, target_key~ : String, source_key~ : (S) -> Value) -> ManyToMany[S, T]Install
Download zipmoonorm — an ORM / SQL toolkit for MoonBit (← SQLAlchemy / SQLModel): a parameterized, injection-safe query builder (select / insert / update / delete).