Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Nov 12, 2025

Summary by CodeRabbit

  • New Features

    • Added PostgreSQL multi-schema support with a new @@Schema model attribute and datasource options (defaultSchema, schemas) for per-model and global schema configuration.
  • Documentation

    • Added a PostgreSQL multi-schema guide and updated reference docs (datasource and zmodel) plus migration notes reflecting multi-schema and seeding guidance.
@vercel
Copy link

vercel bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
zenstack-new-site Ready Ready Preview Comment Nov 12, 2025 3:42pm
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Replaces a query hook import and usage in a React component to use the TanStack Query client API, and adds documentation for PostgreSQL multi-schema support including datasource fields (defaultSchema, schemas) and a model attribute @@schema.

Changes

Cohort / File(s) Change Summary
TanStack Query API Update
src/pages/v3/_components/Service.tsx
Replaced import from @zenstackhq/query/react with @zenstackhq/tanstack-query/react; renamed useQueryHooks(schema)useClientQueries(schema) and updated usages from userHooks.useFindUnique(...)client.user.useFindUnique(...).
PostgreSQL Multi-Schema Documentation
versioned_docs/version-3.x/recipe/postgres-multi-schema.md
New doc explaining PostgreSQL schemas, defaultSchema datasource option, schemas list usage, and per-model @@schema usage with examples.
ZModel Schema Attribute Reference
versioned_docs/version-3.x/reference/zmodel/attribute.md
Added @@schema(_ map: String) attribute documentation and example showing @@schema("auth").
ZModel Datasource Configuration
versioned_docs/version-3.x/reference/zmodel/datasource.md
Added PostgreSQL-specific datasource fields: defaultSchema (default "public") and schemas (list of schemas), with references to multi-schema workflow.
Migration Notes
versioned_docs/version-3.x/migrate-prisma.md
Updated feature-gaps table: removed Postgres Multi-Schema entry and added Database Seeding entry.

Sequence Diagram(s)

sequenceDiagram participant Component as React Component participant Hook as useClientQueries(schema) participant Client as Client API (client.user.*) participant Query as TanStack Query rect rgb(220, 235, 255) Component->>Hook: call useClientQueries(schema) Hook-->>Component: return client end rect rgb(235, 255, 220) Component->>Client: client.user.useFindUnique(params) Client->>Query: delegate to TanStack Query (fetch/ cache) Query-->>Client: result Client-->>Component: data/result end 
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Single-file API migration with consistent pattern change and several new documentation pages.
  • Pay special attention to:
    • src/pages/v3/_components/Service.tsx — ensure the new import path, hook name, and client access pattern match the installed TanStack Query integration.
    • Any example usage in docs that might reference the old hook names or import paths.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change: adding v3 documentation for PostgreSQL multi-schema support.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 227654b and 74ac513.

📒 Files selected for processing (1)
  • versioned_docs/version-3.x/migrate-prisma.md (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ymc9 ymc9 merged commit 9151941 into main Nov 12, 2025
2 of 4 checks passed
@ymc9 ymc9 deleted the docs/pg-schema branch November 12, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants