AstraDBCache(
self,
*,
collection_name: str = ASTRA_DB_CACHE_DEFAULT_COLLECTION_NAME,
token: str| Name | Type | Description |
|---|---|---|
collection_name | str | Default: ASTRA_DB_CACHE_DEFAULT_COLLECTION_NAMEname of the Astra DB collection to create/use. |
token | str | TokenProvider | None | Default: NoneAPI token for Astra DB usage, either in the form of a string
or a subclass of |
api_endpoint | str | None | Default: None |
namespace | str | None | Default: None |
environment | str | None | Default: None |
setup_mode | SetupMode | Default: SetupMode.SYNC |
pre_delete_collection | bool | Default: False |
ext_callers | list[tuple[str | None, str | None] | str | None] | None | Default: None |
api_options | APIOptions | None | Default: None |
full URL to the API endpoint, such as
https://<DB-ID>-us-east1.apps.astra.datastax.com. If not provided,
the environment variable ASTRA_DB_API_ENDPOINT is inspected.
namespace (aka keyspace) where the collection is created. If not provided, the environment variable ASTRA_DB_KEYSPACE is inspected. Defaults to the database's "default namespace".
a string specifying the environment of the target Data API.
If omitted, defaults to "prod" (Astra DB production).
Other values are in astrapy.constants.Environment enum class.
mode used to create the Astra DB collection (SYNC, ASYNC or OFF).
whether to delete the collection before creating it. If False and the collection already exists, the collection will be used as is.
one or more caller identities to identify Data API calls in the User-Agent header. This is a list of (name, version) pairs, or just strings if no version info is provided, which, if supplied, becomes the leading part of the User-Agent string in all API requests related to this component.
an instance of astrapy.utils.api_options.APIOptions that
can be supplied to customize the interaction with the Data API
regarding serialization/deserialization, timeouts, custom headers
and so on. The provided options are applied on top of settings already
tailored to this library, and if specified will take precedence.
Passing None (default) means no customization is requested.
Refer to the astrapy documentation for details.