ormlette/changesets/changesets

Types

pub type Changeset {
  Changeset(
    table: String,
    data: dict.Dict(String, dynamic.Dynamic),
    errors: List(Error),
    valid: Bool,
  )
}

Constructors

  • Changeset(
      table: String,
      data: dict.Dict(String, dynamic.Dynamic),
      errors: List(Error),
      valid: Bool,
    )
pub type Error {
  FieldError(field: String, message: String)
}

Constructors

  • FieldError(field: String, message: String)

Functions

pub fn errors(changeset: Changeset) -> List(Error)
pub fn is_valid(changeset: Changeset) -> Bool
pub fn new(
  table: String,
  data: Dict(String, Dynamic),
) -> Changeset
pub fn validate_boolean(
  changeset: Changeset,
  field: String,
) -> Changeset
pub fn validate_in_list(
  changeset: Changeset,
  field: String,
  allowed_values: List(Dynamic),
) -> Changeset
pub fn validate_max(
  changeset: Changeset,
  field: String,
  max: Int,
) -> Changeset
pub fn validate_min(
  changeset: Changeset,
  field: String,
  min: Int,
) -> Changeset
pub fn validate_min_length(
  changeset: Changeset,
  field: String,
  min_length: Int,
) -> Changeset
pub fn validate_negative(
  changeset: Changeset,
  field: String,
) -> Changeset
pub fn validate_number(
  changeset: Changeset,
  field: String,
) -> Changeset
pub fn validate_positive(
  changeset: Changeset,
  field: String,
) -> Changeset
pub fn validate_present(
  changeset: Changeset,
  fields: List(String),
) -> Changeset
pub fn validate_regex(
  changeset: Changeset,
  field: String,
  pattern: String,
) -> Changeset
Search Document