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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13e2f77959a9af9851c4f15ff41b3e85e610b6f8681c0206fc586c6b3a4c4440 |
|
MD5 | de1e78819b09e6229ab5ae4d882831e2 |
|
BLAKE2b-256 | 7d949438114812ffa21600433ca8d87f16ae296d7fcd58e77b697cc3f71844b1 |
Close
Hashes for pydantic_db_backend-3.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d946ecd08278c23b3784b1dfa1e460371f6785bc7006eb47d64a2865a1607fc |
|
MD5 | e5e94fb698d8afe5b7d83bea689ba258 |
|
BLAKE2b-256 | 5f5b71996d579a454381286d5c149c661fd369de0a08b24a66cee1582c7e4877 |