A TypeScript ORM for Azure Cosmos DB, version 0.4.0. Provides a Lucid-inspired API (all, find, findMany, query) for Cosmos DB NoSQL, with automatic ID generation and timestamps. Requires @azure/cosmos ^4.2.0 and Azure Functions extension bundle [4.0.0,5.0.0). Ships types. Active development.
npm install cosmos-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Cosmos DB client with typed models for user and post containers, queries all posts and finds a user by ID.
Set extensionBundle version in host.json to "[4.0.0, 5.0.0)".
Ensure COSMOS_CONNECTION_STRING env is set and database exists before calling model methods.
Disable auto-generated IDs by setting fields: { id: false } in createModel options if you want to provide custom IDs.Use object syntax: query({ query: '...', parameters: [] }) for forward compatibility.Run npm install cosmos-orm and ensure import matches: import { createClient } from 'cosmos-orm'Switch to ES module syntax: import { createClient } from 'cosmos-orm'Use { query: '...', parameters: [...] }