API

Wasabi.alias — Method
alias(m::String)
Returns the alias of the table for the given model.
source
Wasabi.alias — Method
alias(m::Type{T}) where {T <: Model}
Returns the alias of the table for the given model.
source
Wasabi.all — Function
all(db::Any, m::Type{T}) where {T <: Model}
Returns all rows of the given model.
source
Wasabi.colnames — Method
colnames(m::Type{T}) where {T <: Model}
Returns the names of the columns for the given model.
source
Wasabi.coltype — Method
coltype(m::Type{T}, col::Symbol) where {T <: Model}
Returns the column type for the given column and model.
source
Wasabi.connect — Function
connect(config::ConnectionConfiguration)
Connects to the database using the given configuration.
source
Wasabi.constraints — Method
constraints(m::Type{T}) where {T <: Model}
Returns the constraints for the given model.
source
Wasabi.create_schema — Function
create_schema(db::Any, m::Type{T}) where {T <: Model}
Creates the schema for the given model and constraints.
source
Wasabi.delete! — Function
delete(db::Any, model::T) where {T <: Model}
Deletes the given model from the database.
source
Wasabi.delete_all! — Function
delete_all(db::Any, m::Type{T}) where {T <: Model}
Deletes all rows from the given model.
source
Wasabi.delete_schema — Function
delete_schema(db::Any, m::Type{T}) where {T <: Model}
Deletes the schema for the given model.
source
Wasabi.df2model — Method
df2model(m::Type{T}, df::DataFrame) where {T <: Model}
Converts the given DataFrame to the given model.
source
Wasabi.execute_query — Function
execute_query(db::Any, query::RawQuery, params::Vector{Any})
Executes the given query with the given parameters.
source
Wasabi.first — Function
first(db::Any, m::Type{T}, id::Any) where {T <: Model}
Returns the first row of the given model with the given id.
source
Wasabi.foreign_keys — Method
foreign_keys(m::Type{T})::Vector{ForeignKeyConstraint} where {T<:Model}
Returns the foreign key constraints for the given model.
source
Wasabi.insert! — Function
insert(db::Any, model::T) where {T <: Model}
Inserts the given model into the database.
source
Wasabi.isnullable — Method
isnullable(m::Type{T}, field::Symbol, constraints::Vector{S}) where {T <: Model,S<:Wasabi.ModelConstraint}
Returns true if the given column is nullable.
source
Wasabi.mapping — Function
mapping(db::Type{S}, t::Type{T})::String where {S,T}
Returns the mapping for the given database and type.
source
Wasabi.primary_key — Method
primary_key(m::Type{T})::Union{PrimaryKeyConstraint, Nothing} where {T<:Model}
Returns the primary key constraint for the given model.
source
Wasabi.tablename — Method
tablename(m::Type{T}) where {T <: Model}
Returns the name of the table for the given model.
source
Wasabi.to_sql_value — Function
to_sql_value(db::Type{Any}, v::Any)
Converts the given value to a value that can be used in a SQL query.
source
Wasabi.unique_constraints — Method
unique_constraints(m::Type{T})::Vector{UniqueConstraint} where {T<:Model}
Returns the unique constraints for the given model.
source
Wasabi.update! — Function
update(db::Any, model::T) where {T <: Model}
Updates the given model in the database.
source