No project description provided
Project description
Testing
CouchDB
http://localhost:5984/_utils/#
- user: admin
- passwd: pytest
Initialization
Automatic initialization from environment
init_backend()
Manual initialization
Example for MongoDB with alias.
If missing, the default for alias is "default"
MongoDbBackend(alias="people")
client = Backend.client(alias="people")
Pagination
Usage with routers
@router.get("/people")
@pagination()
def people_get():
return Backend.client().get_instances(PeopleModel)
Custom usage in code
pagination_params = PaginationParameterModel
with pagination_provider(pagination_params) as p:
Backend.client().get_instances(PeopleModel)
pagination_params = PaginationParameterModel
with pagination_provider(pagination_params) as p:
Backend.client().get_instances(PeopleModel)
pagination_params = PaginationParameterModel
with pagination_parameter_provider(pagination_params):
objs, max_results = Backend.client().pagination_aggregate(agg)
return pagination_result((objs, max_results))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pydantic_db_backend-3.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e442e9736d6327db8d671f08badefd4b73ec2aa1fb15c7ce9c0f179e46453060 |
|
MD5 | 532f206c11775ba74eee9451a65f8d04 |
|
BLAKE2b-256 | 52e1870daf4ef996aa5795f709fb403cbf2ad044e4d96407623350dbc168016c |
Close
Hashes for pydantic_db_backend-3.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c500968f2ddb7d9a9a8b6d35a16aa62806d83ed1c5c7f52e2b3a6285908af344 |
|
MD5 | 210702bb09d6a53c918aed157363a1b6 |
|
BLAKE2b-256 | db91dc23201834259f148db8f188e3eda1219b353d6f3e99b464a6d9a0388236 |