# @prisma-next/operations

> Target-neutral operation registry and capability helpers for Prisma Next

Latest version **0.16.0** (published 2026-07-21) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @prisma-next/operations
pnpm add @prisma-next/operations
yarn add @prisma-next/operations
bun add @prisma-next/operations
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.16.0 |
| Published | 2026-07-21 |
| First published | 2025-12-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=24 |
| Dependencies | 0 |
| Unpacked size | 22.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 414 |
| Maintainers | sevinf, tylerhogarth, aqrln, wmadden-prisma |

## Links

- npm: https://www.npmjs.com/package/@prisma-next/operations
- Repository: https://github.com/prisma/prisma-next
- Homepage: https://github.com/prisma/prisma-next#readme
- Issues: https://github.com/prisma/prisma-next/issues
- npm.io page: https://npm.io/package/@prisma-next/operations

## Recent versions

- 0.16.0 (latest) — 2026-07-21
- 0.16.0-dev.35 (dev) — 2026-08-24
- 0.3.0-pr.112.2 (pr) — 2026-01-13
- 0.16.0-dev.34 — 2026-07-27
- 0.16.0-dev.33 — 2026-07-27
- 0.16.0-dev.32 — 2026-07-27
- 0.16.0-dev.31 — 2026-07-27
- 0.16.0-dev.30 — 2026-07-27
- 0.16.0-dev.29 — 2026-07-27
- 0.16.0-dev.28 — 2026-07-24
- 0.16.0-dev.27 — 2026-07-24
- 0.16.0-dev.26 — 2026-07-24
- 0.16.0-dev.25 — 2026-07-24
- 0.16.0-dev.24 — 2026-07-24
- 0.16.0-dev.23 — 2026-07-24
- … 1109 more at https://npm.io/package/@prisma-next/operations/versions

## README

# @prisma-next/operations

Target-neutral operation registry for Prisma Next.

## Overview

This package provides a generic, target-neutral operation registry. It's part of the core ring and has no dependencies on target-specific packages.

## Responsibilities

- **Operation Registry**: Generic operation registry interface and implementation
  - `OperationRegistry<T>`: Generic interface for registering and iterating operations, parameterized by entry type. `register(name, descriptor)` keys each entry by an explicit method name supplied at the call site.
  - `createOperationRegistry<T>()`: Factory function to create operation registries
  - `OperationEntry`: Base entry type with `self` and `impl`
  - `OperationDescriptor<T>`: Alias for the entry shape used at registration sites
  - `OperationDescriptors<T>`: `Readonly<Record<string, OperationDescriptor<T>>>` — the natural shape contributors return, where the record key IS the method name
  - `ParamSpec`: Describes an operation parameter (`codecId`, `nullable`), used for both arguments and return values

## Dependencies


- **Depends on**: Nothing (leaf package)
- **Depended on by**:
  - `@prisma-next/sql-operations` (extends with SQL-specific lowering specs)
  - `@prisma-next/sql-relational-core` (imports `ParamSpec` for AST and type definitions)
  - `@prisma-next/sql-runtime`, `@prisma-next/framework-components`, and other packages that build on the operation registry

## Architecture

```mermaid
flowchart TD
    subgraph "Core Ring"
        OPS[@prisma-next/operations]
    end

    subgraph "Targets Ring"
        SQL_OPS[@prisma-next/sql-operations]
    end

    subgraph "Lanes Ring"
        REL_CORE[@prisma-next/sql-relational-core]
    end

    subgraph "Runtime Ring"
        RT[@prisma-next/runtime]
    end

    OPS --> SQL_OPS
    OPS --> REL_CORE
    OPS --> RT
```

## Usage

### Creating an Operation Registry

```typescript
import { createOperationRegistry, type OperationDescriptor } from '@prisma-next/operations';

const registry = createOperationRegistry();

const descriptor: OperationDescriptor = {
  self: { codecId: 'pg/vector@1' },
  impl: () => ({ returnType: { codecId: 'pg/float8@1', nullable: false } }),
};

registry.register('cosineDistance', descriptor);
const entries = registry.entries(); // Record<string, OperationEntry>
```

### Using a Custom Entry Type

```typescript
import { createOperationRegistry, type OperationEntry } from '@prisma-next/operations';

interface MyEntry extends OperationEntry {
  readonly extra: string;
}

const registry = createOperationRegistry<MyEntry>();

registry.register('myMethod', {
  self: { codecId: 'pg/int4@1' },
  impl: () => undefined as never,
  extra: 'custom data',
});
```

## Package Location

This package is part of the **framework domain**, **core layer**, **shared plane**:
- **Domain**: framework (target-agnostic)
- **Layer**: core
- **Plane**: shared
- **Path**: `packages/1-framework/1-core/operations`

## Related Documentation

- [Package Layering](../../../../docs/architecture docs/Package-Layering.md)
- [ADR 140 - Package Layering & Target-Family Namespacing](../../../../docs/architecture docs/adrs/ADR 140 - Package Layering & Target-Family Namespacing.md)

---
_Source: https://npm.io/package/@prisma-next/operations · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
