module translation.translation_to_python
¶
Short summary¶
module pysqllike.translation.translation_to_python
One class which visits a syntax tree.
Classes¶
class |
truncated documentation |
---|---|
Translates a code into Python. |
Methods¶
method |
truncated documentation |
---|---|
constructor |
|
Interprets a select statement. |
|
Interprets a select statement. |
|
Indicates all nodes containing information about returned results. |
|
Builds the signature of a function based on its name and its children. |
|
Interprets a where statement. |
Documentation¶
One class which visits a syntax tree.
- class pysqllike.translation.translation_to_python.Translate2Python(code_func)¶
Bases:
TranslateClass
Translates a code into Python.
constructor
- Parameters:
code_func – code (str) or function(func)
- GroupBy(name, table, rows)¶
Interprets a select statement.
- Parameters:
name – name of the table which receives the results
table – name of the table it applies to
rows – rows to consider
- Returns:
list of strings (code)
- Select(name, table, rows)¶
Interprets a select statement.
- Parameters:
name – name of the table which receives the results
table – name of the table it applies to
rows – rows to consider
- Returns:
list of strings (code)
- Signature(name, rows)¶
Builds the signature of a function based on its name and its children.
- Parameters:
name – name
rows – list of arguments
- Returns:
list of strings (code)
- Where(name, table, rows)¶
Interprets a where statement.
- Parameters:
name – name of the table which receives the results
table – name of the table it applies to
rows – rows to consider
- Returns:
list of strings (code)
- __init__(code_func)¶
constructor
- Parameters:
code_func – code (str) or function(func)
- setReturn(nodes)¶
Indicates all nodes containing information about returned results.
- Parameters:
nodes – list of nodes
- Returns:
list of string