---
title: "Prisma 2.0: ORM TypeScript-first con schema dichiarativo"
description: "Prisma 2.0 (giugno 2020) di Prisma Labs: ORM TypeScript/Node.js con schema DSL dichiarativo, migrations, query builder type-safe, Prisma Studio. PostgreSQL, MySQL, SQLite, SQL Server, MongoDB. Standard Node.js moderno."
url: "https://www.noze.it/insights/prisma-2-0/"
lang: "it"
alternate: "https://www.noze.it/en/insights/prisma-2-0/"
published: "2020-07-15"
author: "noze S.r.l."
keywords: "Open Source, Web, Prisma, TypeScript, Node.js, ORM, Database"
---

# Prisma 2.0: ORM TypeScript-first con schema dichiarativo

Prisma 2.0 (giugno 2020) di Prisma Labs: ORM TypeScript/Node.js con schema DSL dichiarativo, migrations, query builder type-safe, Prisma Studio. PostgreSQL, MySQL, SQLite, SQL Server, MongoDB. Standard Node.js moderno.

15 luglio 2020

## ORM Node.js: un vuoto

L’ecosistema Node ha storicamente avuto ORM problematici:

- **Sequelize** — pattern Active Record, TypeScript spesso “aggiunto dopo”
- **TypeORM** — decoratori, bug noti, manutenzione lenta
- **Mikro-ORM**, **Objection.js**, **Knex** — nicchia

Serve un approccio **schema-first**, **type-safe**, **DX-moderna**.

## Il rilascio

**Prisma 2.0** è rilasciato da **Prisma Labs** (Berlin) il **9 giugno 2020**. Licenza **Apache 2.0**. Founder: **Søren Bramer Schmidt**, **Johannes Schickling**. Versione 1.x era GraphQL-focused; la 2.0 pivota a ORM general purpose.

## Architettura

- **Schema DSL** (`schema.prisma`) — definizione dichiarativa di model, field, relazioni
- **Prisma Client** — TypeScript client generato da schema
- **Prisma Migrate** — migrations basate su schema diff
- **Prisma Studio** — GUI per browsing DB

```
model User {
  id    Int    @id @default(autoincrement())
  email String @unique
  posts Post[]
}

model Post {
  id       Int    @id @default(autoincrement())
  title    String
  author   User   @relation(fields: [authorId], references: [id])
  authorId Int
}
```

```
const users = await prisma.user.findMany({
  where: { email: { endsWith: '@example.com' } },
  include: { posts: true }
});
// users is typed: User & { posts: Post[] }[]
```

## Caratteristiche

- **Type safety end-to-end** — tipi generati da schema, zero manual typing
- **Query builder** fluent — no raw SQL (anche se supportato con `$queryRaw`)
- **Migrations** dichiarative
- **Auto-complete** completo in IDE
- **Nested writes** — crea record correlati in una call
- **Introspection** — genera schema da DB esistente (`prisma db pull`)
- **Seed** data
- **Multi-DB**: PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, CockroachDB

## Prisma Accelerate & Pulse

Prodotti commerciali Prisma:

- **Accelerate** — connection pooling e cache globale (Edge-compatibile)
- **Pulse** — change data capture real-time
- **Prisma Data Platform** — console cloud

## Concorrenti

- **TypeORM**, **Sequelize** — ORM Node storici con pattern Active Record / Data Mapper
- **Mikro-ORM** — Data Mapper alternativa

## Nel contesto italiano

Prisma sta entrando nei team Node.js italiani TypeScript-first: startup fintech/SaaS/AI, team che migrano da Sequelize/TypeORM, progetti Next.js fullstack.

Aggiornamento — 2026

Evoluzione versioni: **3.0** (referential actions, PlanetScale support, settembre 2021), **4.0** (Node 14+, MongoDB GA, giugno 2022), **5.0** (Node 16+, performance boost, luglio 2023), **6.0** (Node 18+, migrazione query engine da Rust a TypeScript, novembre 2024). Emergono concorrenti: **Drizzle ORM** (2022+, TypeScript SQL-like, zero-abstraction, Edge-friendly) in forte crescita; **Kysely** (type-safe query builder senza schema). Prisma è insegnato come ORM di default nei bootcamp TypeScript italiani e si integra con **NestJS** (via `@nestjs/prisma`) e **Edge runtime** (Cloudflare Workers) tramite Accelerate.

---

_Riferimenti: Prisma 2.0 (9 giugno 2020). Prisma Labs, Berlin. Søren Bramer Schmidt, Johannes Schickling. Licenza Apache 2.0. Schema DSL, Client, Migrate, Studio. Multi-DB._
