interface CosmosAdapterOptionsBase
extends Pick<DatabaseAdapterOptions, "logQueries">
Since 0.2.0

The options both CosmosAdapterOptions arms share — everything that is required or optional regardless of how the client is supplied.

Properties

Since 0.2.0
readonly
database: string

The database the containers live in. Required on both arms: a Cosmos endpoint encodes no database name, so unlike a MongoDB URI there is nothing to fall back to.

Since 0.2.0
readonly
optional
containers: Readonly<Record<string, CosmosEntityMapping>>

Per-entity container, primary-key and partition-key overrides, keyed by the entity name passed to getRepository().

An entity with no entry uses its own name as the container and 'id' as the primary key, and its partition key is DISCOVERED from the container definition — which is both less to configure and safer, since a wrong partition key answers 404 rather than an error. A declared partitionKey is validated against the container and refused by name when it disagrees.

Usage

import { type CosmosAdapterOptionsBase } from "database-plugin/src/index.ts";