Module:CargoUtil/doc

Lua metamodule that simplifies operations related to Cargo queries.

full_query (tables, fields, args)
Performs a Cargo query of unbounded size, for queries that contain more than 5,000 rows. Has the same arguments as, except args.limit is ignored; this function supplies the appropriate limit and offset values to obtain all rows.

equijoin (result1, result2, column)
Returns the equi-join of the two queries on the given comma-separated list of columns. The results are sorted by the given columns; rows that compare equal for the given columns do not necessarily appear in the same order.

order_by_self (result, columnstr)
Sorts the rows of the query result, in-place, using, which accepts   and   as optional sort directions, as if by an   clause. This is not a stable sort; rows that compare equal for the given columns do not necessarily appear in the same order.

make_sql_equality_check_string(x)
Returns a string that is valid to use in the where clause of a SQL query immediately following an expression.

If  is a table, the   operator is used. If  is a string or a table with only one string, the   operator is used. If  is nil or an empty table, the   operator is used.