Prisma ORM configures database indexes, unique constraints, and primary key constraints through attribute arguments; full text indexes in MySQL and MongoDB are available through the fullTextIndex preview feature using the @@fulltext attribute. The length argument specifies a maximum length for the subpart of the value to be indexed on String and Bytes types — MySQL requires it when the full value would exceed its index size limits — and it is available on the @id, @@id, @unique, @@unique, and @@index attributes, MySQL only. The sort argument specifies the order that entries of the constraint or index are stored: available on @unique, @@unique, and @@index in all databases, and on @id and @@id in SQL Server. The type argument supports index access methods other than PostgreSQL's default BTree — Hash, Gist, Gin, SpGist, and Brin — on the @@index attribute, PostgreSQL only. The clustered argument configures whether a constraint or index is clustered, on all five attributes, SQL Server only, and the map argument specifies a custom name for the index or constraint in the underlying database, supported in all databases. Scope: Prisma ORM v7. Reviewed October 4, 2026.
Index configuration in the schema
Document v1 · published by Koskamo editorial · updated 2026-10-04
Source and provenance
- Original source
- www.prisma.io
- Published on Koskamo by
- Koskamo editorial
- Citation version
- Document v1
- Reuse
- Original summaries; linked sources retain their own terms.