Skip to content

docs(skills): teach the PSL expression-index form Prisma Next 0.17 added - #897

Open
coderdan wants to merge 1 commit into
mainfrom
docs/skill-psl-functional-indexes
Open

docs(skills): teach the PSL expression-index form Prisma Next 0.17 added#897
coderdan wants to merge 1 commit into
mainfrom
docs/skill-psl-functional-indexes

Conversation

@coderdan

Copy link
Copy Markdown
Contributor

Closes #895.

The stash-prisma skill's "Indexing encrypted columns" section claimed schema.prisma cannot express functional indexes and prescribed hand-written rawSql operations as the only path. True on 0.16; false since #749 moved us to Prisma Next 0.17.

Verified against the installed @prisma/orm-family-sql@0.17.0 dist (interpreter's indexModelSpec): @@index accepts expression, where, unique, name/map, type, options, with three enforced rules — expression XOR fields, expression requires name/map, options requires type. The expression string is the whole element list between the CREATE INDEX parens, inserted verbatim (target-postgres pgRenderCreateIndex).

Changes:

  • skills/stash-prisma: the four capability recipes are now @@index(expression:) blocks in schema.prisma; the interpreter's three rules are stated; the Json recipe explains why it carries its own parens and opclass. rawSql stays for ANALYZE (PSL has no form for it — an expression index has no statistics until it runs) and as the fallback for DDL PSL can't carry (CREATE INDEX CONCURRENTLY).
  • skills/stash-indexing: the per-integration pointer for Prisma Next updated from "schema language cannot express functional indexes" to the @@index(expression:) form.
  • Changeset: stash patch — skills/ ships in the tarball.

Auto-deriving these indexes from the codec (no user-authored index at all) is #896.

Since 0.17, `@@index` takes an `expression` argument, so the eql_v3.*
functional indexes belong in schema.prisma rather than hand-written rawSql
operations — the claim that PSL cannot express them predates the upgrade
merged in #749. rawSql keeps the ANALYZE (no PSL form exists) and stays
documented as the fallback for DDL PSL cannot carry, e.g. CONCURRENTLY.

Closes #895
@coderdan
coderdan requested a review from a team as a code owner August 14, 2026 03:39
@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 513d6d8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
stash Patch
@cipherstash/basic-example Patch
@cipherstash/e2e Patch
@cipherstash/stack Patch
@cipherstash/stack-drizzle Patch
@cipherstash/stack-supabase Patch
@cipherstash/stack-prisma Patch
@cipherstash/wizard Patch
@cipherstash/bench Patch
@cipherstash/test-kit Patch
@cipherstash/prisma-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stash-prisma skill: functional-index guidance is stale on Prisma Next 0.17

1 participant