# @uplo/adapter-prisma

Latest version **0.24.0** (published 2026-05-20) · MIT license · 75 weekly downloads

## Install

```sh
npm install @uplo/adapter-prisma
pnpm add @uplo/adapter-prisma
yarn add @uplo/adapter-prisma
bun add @uplo/adapter-prisma
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.24.0 |
| Published | 2026-05-20 |
| First published | 2021-05-04 |
| Weekly downloads | 75 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 29 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 15 |
| Maintainers | jpalumickas |
| Keywords | mysql, postgres, postgresql, prisma, upload, uploads |

## Links

- npm: https://www.npmjs.com/package/@uplo/adapter-prisma
- Repository: https://github.com/jpalumickas/uplo
- Homepage: https://uplo.js.org
- npm.io page: https://npm.io/package/@uplo/adapter-prisma

## Dependencies (1)

- [@uplo/types](https://npm.io/package/@uplo/types.md) ^0.24.0

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads
- [database-js2](https://npm.io/package/database-js2.md) — 28 weekly downloads

## Recent versions

- 0.24.0 (latest) — 2026-05-20
- 0.23.0 — 2026-03-14
- 0.22.0 — 2025-06-19
- 0.21.0 — 2024-10-29
- 0.20.0 — 2024-09-17
- 0.19.4 — 2024-03-30
- 0.19.3 — 2024-03-17
- 0.19.2 — 2024-03-17
- 0.19.1 — 2024-03-17
- 0.19.0 — 2024-03-17
- 0.18.2 — 2023-05-31
- 0.18.1 — 2023-05-31
- 0.18.0 — 2023-05-17
- 0.17.11 — 2023-04-05
- 0.17.10 — 2023-04-05
- … 34 more at https://npm.io/package/@uplo/adapter-prisma/versions

## README

# @uplo/adapter-prisma

[Prisma](https://www.prisma.io) ORM adapter for [Uplo](https://uplo.js.org).

## Installation

```sh
npm i @uplo/adapter-prisma dataloader
```

## Usage

```ts
import { createPrismaAdapter } from '@uplo/adapter-prisma'

const uplo = createUplo({
  adapter: createPrismaAdapter({ prisma }),
})
```

## Prisma schema

```prisma
model FileAttachment {
  id         String   @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  name       String   @db.VarChar
  recordType String   @db.VarChar
  recordId   String   @db.Uuid
  blobId     String   @db.Uuid
  createdAt  DateTime @default(now()) @db.Timestamptz(6)

  blob       FileBlob @relation(fields: [blobId], references: [id])

  @@unique([recordType, recordId, name, blobId])
  @@index([recordType, recordId, name])
  @@index([blobId])
}

model FileBlob {
  id            String           @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  serviceName   String           @db.VarChar
  key           String           @unique @db.VarChar
  fileName      String           @db.VarChar
  contentType   String?          @db.VarChar
  size          BigInt
  checksum      String           @db.VarChar
  metadata      Json             @default("{}")
  createdAt     DateTime         @default(now()) @db.Timestamptz(6)

  attachments   FileAttachment[]
}
```

## Documentation

See the full docs at [uplo.js.org](https://uplo.js.org/adapters/prisma).

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