SearchLight.SQLInput - Type

Provides safe input into SQL queries and operations related to that.

source


SearchLight.SQLColumn - Type

Represents a SQL column when building SQL queries.

source


SearchLight.SQLLogicOperator - Type

Represents the logic operators (OR, AND) as part of SQL queries.

source


SearchLight.SQLWhere - Type

Provides functionality for building and manipulating SQL WHERE conditions.

source


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 |                                        |
+----------------+----------------------------------------+

source


SearchLight.SQLLimit - Type

Wrapper around SQL limit operator.

source


SearchLight.SQLOrder - Type

Wrapper around SQL order operator.

source


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 |                                                 +========... |
+---------+--------------------------------------------------------------+

source


SearchLight.SQLRaw - Type

Wrapper around a raw SQL query part.

source


SearchLight.SQLJoin - Type

Builds and manipulates SQL join expressions.

source


SearchLight.SQLOn - Type

Represents the ON operator used in SQL JOIN

source


SearchLight.SQLJoinType - Type

Wrapper around the various types of SQL join (left, right, inner, etc).

source



Genie