OrmCrud
ormdantic.generator._crud.OrmCrud
Bases: Generic[ModelType]
Provides DB CRUD methods and table information for a model.
Initialize OrmCrud.
PARAMETER | DESCRIPTION |
---|---|
table_data |
TYPE:
|
table_map |
TYPE:
|
engine |
TYPE:
|
Source code in ormdantic/generator/_crud.py
find_one
async
Find a model instance by primary key.
PARAMETER | DESCRIPTION |
---|---|
pk |
TYPE:
|
depth |
TYPE:
|
Source code in ormdantic/generator/_crud.py
find_many
async
Find many model instances.
PARAMETER | DESCRIPTION |
---|---|
where |
TYPE:
|
order_by |
TYPE:
|
order |
TYPE:
|
limit |
TYPE:
|
offset |
TYPE:
|
depth |
TYPE:
|
Source code in ormdantic/generator/_crud.py
insert
async
Insert a model instance.
PARAMETER | DESCRIPTION |
---|---|
model_instance |
TYPE:
|
update
async
Update a record.
PARAMETER | DESCRIPTION |
---|---|
model_instance |
TYPE:
|
upsert
async
Insert a record if it does not exist, else update it.
PARAMETER | DESCRIPTION |
---|---|
model_instance |
TYPE:
|
delete
async
Delete a model instance by primary key.
PARAMETER | DESCRIPTION |
---|---|
pk |
TYPE:
|
count
async
Count records.
PARAMETER | DESCRIPTION |
---|---|
where |
TYPE:
|
depth |
TYPE:
|