ormlette/ir/ir

Types

pub type ColumnConstraint {
  PrimaryKey
  Nullable
  Unique
  ForeignKey(
    references_table: TableIR,
    references_column: String,
    on_delete: Option(String),
    on_update: Option(String),
  )
}

Constructors

  • PrimaryKey
  • Nullable
  • Unique
  • ForeignKey(
      references_table: TableIR,
      references_column: String,
      on_delete: Option(String),
      on_update: Option(String),
    )
pub type ColumnIR {
  ColumnIR(
    name: String,
    type_: c.ColumnType,
    constraints: List(ColumnConstraint),
    default: Option(dynamic.Dynamic),
  )
}

Constructors

  • ColumnIR(
      name: String,
      type_: c.ColumnType,
      constraints: List(ColumnConstraint),
      default: Option(dynamic.Dynamic),
    )
pub type TableIR {
  TableIR(name: String, columns: List(ColumnIR))
}

Constructors

  • TableIR(name: String, columns: List(ColumnIR))

Functions

pub fn inverse_ir(table_ir: TableIR) -> String
pub fn to_ir(table: Table) -> TableIR
pub fn to_sql_drop(table_ir: TableIR) -> String
Search Document