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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb5101dc74a713a816eaf17b8a8ae14ea8267fe473c9e0783e8fc5509cac89ac |
|
MD5 | 774fe3a59ac58ce27ac9108d115121c3 |
|
BLAKE2b-256 | 5a129ba55f8c321d624c6d5edb73a3c4d7b722cec611130adb2f0f65cb66e50e |
Close
Hashes for pydantic_db_backend-3.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5297a5c7da9511937e13be41f5d092b3186ace7c4024303eb7f4258c2bb78b6f |
|
MD5 | 19bbef9164aa9b7cfdb2cadb9f2674b4 |
|
BLAKE2b-256 | 2e0e02b002a9aaf9b8dd998914ea6a4d7782fbc501e3e5baa47d47631a3fa7b5 |