sql#

swordfish.sql(sql, *, vars=None)#

Executes a SQL query.

Parameters:
  • sql (str) – The SQL query to be executed.

  • vars (dict, optional) – A dictionary of variables to be involved in the query. Default is None.

Returns:

The result of executing the SQL query.

Return type:

Constant

Examples

>>> import swordfish as sf
>>> import swordfish.function as F
>>> sf.sql("SELECT * FROM table(1..10 as a) WHERE Func(a) > 0",
...        vars={'Func': F.abs})