SearchLight.SQLWhere - Type
Provides functionality for building and manipulating SQL WHERE
conditions.
SearchLight.SQLWhereExpression - Type
SQLWhereExpression(sql_expression::String, values::T)
SQLWhereExpression(sql_expression::String[, values::Vector{T}])
Constructs an instance of SQLWhereExpression, replacing the ?
placeholders inside sql_expression
with properly quoted values.
Examples:
julia> SQLWhereExpression("slug LIKE ?", "%julia%")
SearchLight.SQLWhereExpression
+================+=============+
| key | value |
+================+=============+
| condition | AND |
+----------------+-------------+
| sql_expression | slug LIKE ? |
+----------------+-------------+
| values | '%julia%' |
+----------------+-------------+
julia> SQLWhereExpression("id BETWEEN ? AND ?", [10, 20])
SearchLight.SQLWhereExpression
+================+====================+
| key | value |
+================+====================+
| condition | AND |
+----------------+--------------------+
| sql_expression | id BETWEEN ? AND ? |
+----------------+--------------------+
| values | 10,20 |
+----------------+--------------------+
julia> SQLWhereExpression("question LIKE 'what is the question\?'")
SearchLight.SQLWhereExpression
+================+========================================+
| key | value |
+================+========================================+
| condition | AND |
+----------------+----------------------------------------+
| sql_expression | question LIKE 'what is the question?' |
+----------------+----------------------------------------+
| values | |
+----------------+----------------------------------------+
SearchLight.SQLQuery - Type
SQLQuery( columns = SQLColumn[],
where = SQLWhereEntity[],
limit = SQLLimit("ALL"),
offset = 0,
order = SQLOrder[],
group = SQLColumn[],
having = SQLWhereEntity[])
Returns a new instance of SQLQuery.
Examples
julia> SQLQuery(where = [SQLWhereExpression("id BETWEEN ? AND ?", [10, 20])], offset = 5, limit = 5, order = :title)
SearchLight.SQLQuery
+=========+==============================================================+
| key | value |
+=========+==============================================================+
| columns | |
+---------+--------------------------------------------------------------+
| group | |
+---------+--------------------------------------------------------------+
| having | Union{SearchLight.SQLWhere,SearchLight.SQLWhereExpression}[] |
+---------+--------------------------------------------------------------+
| limit | 5 |
+---------+--------------------------------------------------------------+
| offset | 5 |
+---------+--------------------------------------------------------------+
| | SearchLight.SQLOrder[ |
| | SearchLight.SQLOrder |
| | +===========+=========+ |
| | | key | value | |
| order | +========... |
+---------+--------------------------------------------------------------+
| | Union{SearchLight.SQLWhere,SearchLight.SQLWhereExpression}[ |
| | SearchLight.SQLWhereExpression |
| where | +========... |
+---------+--------------------------------------------------------------+
SearchLight.SQLJoinType - Type
Wrapper around the various types of SQL join
(left
, right
, inner
, etc).