docs(skills): teach the PSL expression-index form Prisma Next 0.17 added - #897
Merged
Conversation
🦋 Changeset detectedLatest commit: 68c4cae The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
Contributor
Author
P2: Include options in the TypeScript index example
For TypeScript-authored Postgres contracts, specifying |
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
…, TS options requirement, no CONCURRENTLY in the runner The rawSql fallback cannot carry CREATE INDEX CONCURRENTLY (the runner wraps every apply in one transaction; Postgres rejects it with 25001), name: mints <name>_<8-hex hash> physical names so verification must prefix-match, and the TS index() form requires options whenever type is present. Deeper reconciliation of the recipe is deferred to #896, which derives these indexes automatically via the onFieldEvent codec hook.
coderdan
force-pushed
the
docs/skill-psl-functional-indexes
branch
from
August 19, 2026 03:05
513d6d8 to
68c4cae
Compare
coderdan
requested review from
freshtonic and
tobyhede
and removed request for
tobyhede
August 19, 2026 03:22
freshtonic
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #895.
The
stash-prismaskill's "Indexing encrypted columns" section claimedschema.prismacannot express functional indexes and prescribed hand-writtenrawSqloperations 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.0dist (interpreter'sindexModelSpec):@@indexacceptsexpression,where,unique,name/map,type,options, with three enforced rules — expression XOR fields, expression requiresname/map,optionsrequirestype. The expression string is the whole element list between theCREATE INDEXparens, inserted verbatim (target-postgrespgRenderCreateIndex).Changes:
skills/stash-prisma: the four capability recipes are now@@index(expression:)blocks inschema.prisma; the interpreter's three rules are stated; the Json recipe explains why it carries its own parens and opclass.rawSqlstays forANALYZE(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.stashpatch —skills/ships in the tarball.Auto-deriving these indexes from the codec (no user-authored index at all) is #896.