OrmField
ormdantic.generator._field.OrmField
Build SQL queries from field information.
Build CRUD queries from tablename and field info.
:param table_data: Meta data of target table for SQL script. :param table_map: Map of tablenames and models.
PARAMETER | DESCRIPTION |
---|---|
table_data |
TYPE:
|
table_map |
TYPE:
|
Source code in ormdantic/generator/_field.py
get_find_one_query
Get query to find one model.
PARAMETER | DESCRIPTION |
---|---|
pk |
TYPE:
|
depth |
TYPE:
|
Source code in ormdantic/generator/_field.py
get_find_many_query
Get find query for many records.
:param where: Dictionary of column name to desired value. :param order_by: Columns to order by. :param order: Order results by ascending or descending. :param limit: Number of records to return. :param offset: Number of records to offset by. :param depth: Depth of relations to populate. :return: A list of models representing table records.
PARAMETER | DESCRIPTION |
---|---|
where |
TYPE:
|
order_by |
TYPE:
|
order |
TYPE:
|
limit |
TYPE:
|
offset |
TYPE:
|
depth |
TYPE:
|
Source code in ormdantic/generator/_field.py
get_delete_query
Get a delete
query.
:param pk: Primary key of the record to delete. :return: Query to delete a record.
PARAMETER | DESCRIPTION |
---|---|
pk |
TYPE:
|
Source code in ormdantic/generator/_field.py
get_count_query
Get a count
query.
:param where: Dictionary of column name to desired value. :param depth: Depth of relations to populate. :return: Query to count records.
PARAMETER | DESCRIPTION |
---|---|
where |
TYPE:
|
depth |
TYPE:
|