API Reference
Modeling
These are used for defining queries.
altqq.Query
Base class for query definitions.
This class can be inherited instead of providing the QueryMeta
as the
class metaclass.
Source code in src/altqq/structs.py
altqq.NonParameter
Non-parameter type hint.
altqq.ListParameter
List parameter type hint.
altqq.Calculated
Calculated value assignment.
PyODBC
These are used for working with PyODBC.
altqq.to_pyodbc(query)
Converts a Query
to its corresponding PyODBCQuery
object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
Query
|
Query to translate to PyODBC |
required |
Returns:
Name | Type | Description |
---|---|---|
PyODBCQuery |
PyODBCQuery
|
Equivalent query for PyODBC usage. |
Source code in src/altqq/__init__.py
altqq.PyODBCQuery
dataclass
Psycopg
These are used for working with Psycopg.
altqq.to_psycopg(query)
Converts a Query
to its corresponding PsycopgQuery
object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
Query
|
Query to translate to Psycopg |
required |
Returns:
Name | Type | Description |
---|---|---|
PsycopgQuery |
PsycopgQuery
|
Equivalent query for Psycopg usage. |
Source code in src/altqq/__init__.py
altqq.PsycopgQuery
dataclass
Plain Text
These are used for working with plain text SQL.
altqq.to_plain_text(query)
Converts a Query
to a plain text SQL.
The conversion to plain text also handles some of the data types. None
is converted to NULL
, numeric values are written as they are and
string values and other object types are escaped using '
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
Query
|
Query to convert. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Query as plain text. |