SQLAlchemy
append_filter_to_statement
¶
append_filter_to_statement(
statement: Select[_T], model: Type[_Model], filter_: _Filter
) -> Select[_T]
Append filtering to statement.
PARAMETER | DESCRIPTION |
---|---|
statement |
Some select statement.
TYPE:
|
model |
Declaratively defined model.
TYPE:
|
filter_ |
Filter object.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
AttributeNotFoundSaDriverError
|
Attribute not found |
RelationshipNotFoundSaDriverError
|
Relationship not found |
Source code in pydantic_filters/drivers/sqlalchemy/_main.py
append_pagination_to_statement
¶
Append pagination to statement.
PARAMETER | DESCRIPTION |
---|---|
statement |
Some select statement.
TYPE:
|
pagination |
Pagination object.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
AttributeNotFoundSaDriverError
|
Attribute not found |
Source code in pydantic_filters/drivers/sqlalchemy/_main.py
append_sort_to_statement
¶
append_sort_to_statement(
statement: Select[_T], model: Type[_Model], sort: _Sort
) -> Select[_T]
Append sorting to statement.
PARAMETER | DESCRIPTION |
---|---|
statement |
Some select statement.
TYPE:
|
model |
Declaratively defined model.
TYPE:
|
sort |
Sort object.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
AttributeNotFoundSaDriverError
|
Attribute not found |
Source code in pydantic_filters/drivers/sqlalchemy/_main.py
append_to_statement
¶
append_to_statement(
statement: Select[_T],
model: Type[_Model],
*,
filter_: Optional[_Filter] = None,
sort: Optional[_Sort] = None,
pagination: Optional[_Pagination] = None
) -> Select[_T]
All in one function.
PARAMETER | DESCRIPTION |
---|---|
statement |
Some select statement.
TYPE:
|
model |
Declaratively defined model.
TYPE:
|
filter_ |
Filter object.
TYPE:
|
sort |
Sort object.
TYPE:
|
pagination |
Pagination object.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
AttributeNotFoundSaDriverError
|
Attribute not found |
RelationshipNotFoundSaDriverError
|
Relationship not found |
Source code in pydantic_filters/drivers/sqlalchemy/_main.py
get_count_statement
¶
get_count_statement(model: Type[_Model], filter_: _Filter) -> Select[_T]
Get count statement.
PARAMETER | DESCRIPTION |
---|---|
model |
Declaratively defined model.
TYPE:
|
filter_ |
Filter object.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
AttributeNotFoundSaDriverError
|
Attribute not found. |
RelationshipNotFoundSaDriverError
|
Relationship not found. |
SupportSaDriverError
|
Composite primary keys are not supported. |
Source code in pydantic_filters/drivers/sqlalchemy/_main.py
AttributeNotFoundSaDriverError
¶
Bases: BaseSaDriverError
RelationshipNotFoundSaDriverError
¶
Bases: BaseSaDriverError
SupportSaDriverError
¶
Bases: BaseSaDriverError
Driver support error