interface CosmosDatabaseOptions
Since 0.2.0

The arm selecting the Cosmos adapter over the @azure/cosmos SDK — Azure Cosmos DB's NoSQL (SQL) API.

options.database is required, and options.endpoint + options.key are required unless options.client is supplied, so a registration that forgets them is a compile error instead of a connect() throw — the guarantee every other built-in arm gives.

Cosmos DB's MongoDB API is a different wire protocol and is served by the MongoDatabaseOptions arm pointed at a Cosmos connection string, not by this one.

Examples

Example 1

import { DatabasePlugin } from '@setu-ts/database-plugin';

DatabasePlugin({
  type: 'cosmos',
  options: {
    endpoint: 'https://my-account.documents.azure.com:443/',
    key: cosmosKey,
    database: 'app',
  },
});

Properties

readonly
type: "cosmos"

Selects the Cosmos arm.

Cosmos adapter configuration; database and one credential form are required.

Usage

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