Ducker.Validation behaviour (ducker v0.2.0)

View Source

Validation is specified using a YAML file with the following structure:

table: <table_name>
validations:
  - validate: <expression>
    where: <where_clause>
    type: <type>
  - unique: [<column1>, <column2>, ...]
    where: <where_clause>
    type: <type>
  - reference: <table_name>
    where: <where_clause>
    columns: [<column1>, <column2>, ...]
    foreign_columns: [<column1>, <column2>, ...]

Summary

Callbacks

validate(config)

@callback validate(config :: map()) :: {name :: binary(), sql :: binary()}

Functions

do_validate(ducker, arg)