API

Wasabi.aliasMethod
alias(m::String)
Returns the alias of the table for the given model.
source
Wasabi.aliasMethod
alias(m::Type{T}) where {T <: Model}
Returns the alias of the table for the given model.
source
Wasabi.allFunction
all(db::Any, m::Type{T}) where {T <: Model}
Returns all rows of the given model.
source
Wasabi.colnamesMethod
colnames(m::Type{T}) where {T <: Model}
Returns the names of the columns for the given model.
source
Wasabi.coltypeMethod
coltype(m::Type{T}, col::Symbol) where {T <: Model}
Returns the column type for the given column and model.
source
Wasabi.connectFunction
connect(config::ConnectionConfiguration)
Connects to the database using the given configuration.
source
Wasabi.constraintsMethod
constraints(m::Type{T}) where {T <: Model}
Returns the constraints for the given model.
source
Wasabi.create_schemaFunction
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_schemaFunction
delete_schema(db::Any, m::Type{T}) where {T <: Model}
Deletes the schema for the given model.
source
Wasabi.df2modelMethod
df2model(m::Type{T}, df::DataFrame) where {T <: Model}
Converts the given DataFrame to the given model.
source
Wasabi.execute_queryFunction
execute_query(db::Any, query::RawQuery, params::Vector{Any})
Executes the given query with the given parameters.
source
Wasabi.firstFunction
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_keysMethod
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.isnullableMethod
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.mappingFunction
mapping(db::Type{S}, t::Type{T})::String where {S,T}
Returns the mapping for the given database and type.
source
Wasabi.primary_keyMethod
primary_key(m::Type{T})::Union{PrimaryKeyConstraint, Nothing} where {T<:Model}
Returns the primary key constraint for the given model.
source
Wasabi.tablenameMethod
tablename(m::Type{T}) where {T <: Model}
Returns the name of the table for the given model.
source
Wasabi.to_sql_valueFunction
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_constraintsMethod
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