Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydantic_db_backend-3.4.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

pydantic_db_backend-3.4.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_db_backend-3.4.0.tar.gz.

File metadata

  • Download URL: pydantic_db_backend-3.4.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.12.3 Linux/6.8.0-49-generic

File hashes

Hashes for pydantic_db_backend-3.4.0.tar.gz
Algorithm Hash digest
SHA256 e5d269d0c53260916ae7a0891b50d6e67276422fd7a28fdda91a247266fae32d
MD5 83ec5aac913c9a176e54ebec9b98d01d
BLAKE2b-256 d65e19dcd6f90205299e95dee6fc1ba7f49d1e0c240120315e4cc33403466f77

See more details on using hashes here.

File details

Details for the file pydantic_db_backend-3.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_db_backend-3.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e37667f76d70cd9c0ddff77c02ca4800c0fee9e6f0faa2c7d84f710d722cb62
MD5 e148094cd499e1950c2cb15fb3c9a390
BLAKE2b-256 a33a12ac2521d2233f1a84066f266088aa8e9f5e800c05c31c7ddb593e1803f5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page