Skip to content

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

Merged
coderdan merged 2 commits into
mainfrom
docs/skill-psl-functional-indexes
Aug 19, 2026
Merged

docs(skills): teach the PSL expression-index form Prisma Next 0.17 added#897
coderdan merged 2 commits into
mainfrom
docs/skill-psl-functional-indexes

Conversation

@coderdan

@coderdan coderdan commented Aug 14, 2026

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.

@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: 68c4cae

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

@coderdan

Copy link
Copy Markdown
Contributor Author

P2: Include options in the TypeScript index example

skills/stash-prisma/SKILL.md:224

For TypeScript-authored Postgres contracts, specifying type also requires options; this example fails with TS2769 under the pinned Prisma Next 0.17 types. Add options: {} or omit type for the default btree.

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
coderdan force-pushed the docs/skill-psl-functional-indexes branch from 513d6d8 to 68c4cae Compare August 19, 2026 03:05
@coderdan
coderdan requested review from freshtonic and tobyhede and removed request for tobyhede August 19, 2026 03:22
@coderdan
coderdan merged commit 1486a46 into main Aug 19, 2026
7 of 8 checks passed
@coderdan
coderdan deleted the docs/skill-psl-functional-indexes branch August 19, 2026 03:52
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

2 participants