Skip to content

Commit ae99ab2

Browse files
ABCrimsonclaude
andcommitted
docs: update Prisma version refs to 7.5.0-dev.33, add partial index docs
- Update SETUP.md, ARCHITECTURE.md version references - Document 8 partial indexes in wiki/Database-Schema.md - Add Prisma 7.3+ schema features table to wiki/Architecture.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1ecd5a1 commit ae99ab2

4 files changed

Lines changed: 31 additions & 5 deletions

File tree

ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Shared Prisma 7 database package.
112112

113113
**Tables:** users, accounts, sessions, worksheets, folders, forum_posts, comments, upvotes, audit_logs
114114

115-
**Tech:** Prisma 7.5.0-dev.32, @neondatabase/serverless 1.0.2, @prisma/adapter-neon
115+
**Tech:** Prisma 7.5.0-dev.33, @neondatabase/serverless 1.0.2, @prisma/adapter-neon
116116

117117
### @nextcalc/api
118118

docs/SETUP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Create **separate** OAuth apps for production:
185185
| Next.js | 16.2.0-canary.69 |
186186
| React | 19.3.0-canary |
187187
| TypeScript | 6.0.0-dev.20260301 |
188-
| Prisma | 7.5.0-dev.32 |
188+
| Prisma | 7.5.0-dev.33 |
189189
| Apollo Server | 5.4.0 |
190190
| Biome | 2.5.0 |
191191
| Turborepo | 2.8.13-canary.8 |

docs/wiki/Architecture.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ WebSocket subscriptions authenticate via JWT tokens passed in the connection `co
116116

117117
The Cloudflare rate-limiter Worker uses timing-safe comparison (`crypto.subtle.timingSafeEqual`) for API key validation, preventing timing-based side-channel attacks on the shared secret.
118118

119-
## Prisma 7 Adapter Pattern
119+
## Prisma 7.5 Adapter Pattern
120120

121-
The database package uses Prisma 7's Neon serverless adapter. The adapter constructor takes a **config object**, not a Pool instance:
121+
The database package uses Prisma 7.5.0-dev.33's Neon serverless adapter. The adapter constructor takes a **config object**, not a Pool instance:
122122

123123
```typescript
124124
// Correct
@@ -131,6 +131,15 @@ const adapter = new PrismaNeon(pool);
131131

132132
Prisma 7 creates its own connection pool internally via the adapter's `connect()` method.
133133

134+
### Schema Features (7.3+)
135+
136+
| Feature | Since | Description |
137+
|:--------|:------|:------------|
138+
| `compilerBuild = "fast"` | 7.3 | Speed-optimized query compiler (larger footprint, ideal for Node.js) |
139+
| `partialIndexes` preview | 7.4 | Filtered indexes with `WHERE` conditions for smaller, faster lookups |
140+
| Query plan caching | 7.4 | LRU cache for compiled query plans (~100% hit rate for repeated shapes) |
141+
| BigInt precision in JSON | 7.3 | BigInt values cast to text inside JSON aggregation with `relationJoins` |
142+
134143
## Styling System
135144

136145
- **OKLCH** color tokens in `apps/web/app/globals.css`

docs/wiki/Database-Schema.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Database Schema
22

3-
Prisma 7 with Neon PostgreSQL serverless adapter. Schema: `packages/database/prisma/schema.prisma`.
3+
Prisma 7.5.0-dev.33 with Neon PostgreSQL serverless adapter. Schema: `packages/database/prisma/schema.prisma`.
44

55
---
66

@@ -136,3 +136,20 @@ Key indexes for query performance:
136136
| `postId` | Comment | List comments on a post |
137137
| `parentId` | Folder, Comment | Traverse nested hierarchies |
138138
| `shortCode` | SharedCalculation | Unique lookup for shared links |
139+
140+
### Partial Indexes (Prisma 7.4+)
141+
142+
Filtered indexes that only include non-deleted records. PostgreSQL automatically prefers these smaller indexes when queries include `WHERE deletedAt IS NULL`, dramatically reducing I/O for the vast majority of reads.
143+
144+
| Index Name | Model | Columns | Filter |
145+
|:-----------|:------|:--------|:-------|
146+
| `worksheets_userId_visibility_active_idx` | Worksheet | userId, visibility | `deletedAt IS NULL` |
147+
| `worksheets_createdAt_active_idx` | Worksheet | createdAt DESC | `deletedAt IS NULL` |
148+
| `forum_posts_createdAt_active_idx` | ForumPost | createdAt DESC | `deletedAt IS NULL` |
149+
| `forum_posts_isPinned_createdAt_active_idx` | ForumPost | isPinned, createdAt DESC | `deletedAt IS NULL` |
150+
| `comments_postId_active_idx` | Comment | postId | `deletedAt IS NULL` |
151+
| `comments_parentId_active_idx` | Comment | parentId | `deletedAt IS NULL` |
152+
| `problems_difficulty_popularity_active_idx` | Problem | difficulty, popularity DESC | `deletedAt IS NULL` |
153+
| `problems_createdAt_active_idx` | Problem | createdAt DESC | `deletedAt IS NULL` |
154+
155+
Defined in schema using Prisma 7.4's type-safe syntax: `@@index([field], map: "name", where: { deletedAt: null })`

0 commit comments

Comments
 (0)