# @prisma-next/sql-operations

> SQL-specific operations 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/sql-operations
pnpm add @prisma-next/sql-operations
yarn add @prisma-next/sql-operations
bun add @prisma-next/sql-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 | 3 |
| Unpacked size | 19.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 409 |
| Maintainers | sevinf, tylerhogarth, aqrln, wmadden-prisma |

## Links

- npm: https://www.npmjs.com/package/@prisma-next/sql-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/sql-operations

## Dependencies (3)

- [arktype](https://npm.io/package/arktype.md) ^2.2.2
- [@prisma-next/operations](https://npm.io/package/@prisma-next/operations.md) 0.16.0
- [@prisma-next/sql-contract](https://npm.io/package/@prisma-next/sql-contract.md) 0.16.0

## 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
- … 1012 more at https://npm.io/package/@prisma-next/sql-operations/versions

## README

# @prisma-next/sql-operations

SQL-specific operation types and registry for Prisma Next.

## Package Classification

- **Domain**: sql
- **Layer**: core
- **Plane**: shared

## Overview

This package provides SQL-specific operation types that extend the generic `OperationRegistry` from `@prisma-next/operations` with SQL lowering specs. It lives in the shared plane to allow both migration-plane (emitter/CLI) and runtime-plane (lanes/runtime) packages to import operation types without violating plane boundaries. The package contains only types and pure helpers (no pack I/O, no manifest assembly); manifest assembly is handled by the CLI/tooling layer.

## Responsibilities

- **SQL Operation Types**: SQL-specific operation entry and descriptor types
  - `SqlOperationEntry`: Extends `OperationEntry` with a `lowering` field (`SqlLoweringSpec`)
  - `SqlOperationDescriptor`: Alias for `SqlOperationEntry` used at registration sites
  - `SqlOperationDescriptors`: `Readonly<Record<string, SqlOperationDescriptor>>` — the keyed-record shape adapter/extension `queryOperations()` factories return
  - `SqlLoweringSpec`: SQL-specific lowering specification (`targetFamily`, `strategy`, `template`)
  - `SqlOperationRegistry`: Typed registry alias (`OperationRegistry<SqlOperationEntry>`)

- **Registry Factory**: Typed factory for creating SQL operation registries
  - `createSqlOperationRegistry()`: Creates a typed `SqlOperationRegistry`

## Dependencies

- **Depends on**:
  - `@prisma-next/operations` (core operation registry types)
- **Depended on by**:
  - `@prisma-next/sql-relational-core` (uses for operation execution)
  - `@prisma-next/sql-runtime` (uses for operation signature types)
  - `@prisma-next/cli` (uses types when assembling registries from packs)

## Architecture

```mermaid
flowchart TD
    subgraph "Core Ring (Shared Plane)"
        OPS[@prisma-next/operations]
        SQL_OPS[@prisma-next/sql-operations]
    end

    subgraph "Tooling Ring (Migration Plane)"
        CLI[@prisma-next/cli]
    end

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

    subgraph "Runtime Ring (Runtime Plane)"
        SQL_RUNTIME[@prisma-next/sql-runtime]
    end

    OPS --> SQL_OPS
    CLI --> SQL_OPS
    SQL_OPS --> REL_CORE
    SQL_OPS --> SQL_RUNTIME
```

## Usage

### Creating and Using SQL Operation Registries

```typescript
import {
  createSqlOperationRegistry,
  type SqlOperationDescriptor,
} from '@prisma-next/sql-operations';

const registry = createSqlOperationRegistry();

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

registry.register('cosineDistance', descriptor);

const entries = registry.entries(); // Record<string, SqlOperationEntry>
```

### Assembling Operations from Extension Packs (CLI/Tooling)

For tooling code that works with extension packs, manifest assembly happens in the CLI layer. See `@prisma-next/cli` for pack assembly utilities.

## 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/sql-operations · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
