Powered by Tachyonic Project Luxon Framework v0.0.0

Luxon Framework for rapid application development. (luxon)

Version

SQL Utilites

Build Where

luxon.utils.sql.build_where(**kwargs)[source]

Generates an SQL WHERE string.

Will replace None’s with IS NULL’s.

Keyword Arguments:
 
  • SQL search string (Containing) –
  • Eg{"foo": 1, "bar": None}
Returns:

Tuple containing string that can be used after WHERE in SQL statement, along with a list of the values. Eg. (“foo=? AND bar IS NULL”, [ 1 ])

Build Like

luxon.utils.sql.build_like(operator='AND', **kwargs)[source]

Generates an SQL WHERE string.

Will replace None’s with IS NULL’s.

Keyword Arguments:
 
  • SQL search string (Containing) –
  • Eg{"foo": "x", "bar": None}
Returns:

Tuple containing string that can be used after LIKE in SQL statement, along with a list of the values. Eg. (“foo like ? AND bar IS NULL”, [ “x%” ])