docs: add PGlite section#617
Conversation
|
@sanny-io is attempting to deploy a commit to the ZenStack Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThis PR adds a new documentation section to the PostgreSQL recipe guide describing how to use the PGlite dialect. The section includes a support disclaimer, installation instructions for required packages, and a TypeScript code example showing ZenStackClient configuration with PGliteDialect. ChangesPGlite Usage Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/recipe/databases/postgres.md`:
- Around line 30-49: Add the missing AvailableSince component for the "Using
PGlite" section: import AvailableSince from "_components/AvailableSince" near
the other imports, then insert <AvailableSince version="vX.Y.Z" /> immediately
under the "Using PGlite" heading; replace vX.Y.Z with the actual release version
when PGlite dialect support was introduced.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 010955ac-b9b8-4708-99e3-4c912e9a1e6a
📒 Files selected for processing (1)
docs/recipe/databases/postgres.md
| ## Using PGlite | ||
|
|
||
| :::danger No Official Support | ||
| The PGlite dialect is not officially supported or tested by ZenStack, but you may evaluate it and [report your findings and interest on the GitHub issue](https://github.com/zenstackhq/zenstack/issues/2710). | ||
| ::: | ||
|
|
||
| <PackageInstall dependencies={['@electric-sql/pglite', 'kysely']} /> | ||
|
|
||
| ```ts | ||
| import { schema } from './zenstack/schema'; | ||
| import { PGlite } from '@electric-sql/pglite'; | ||
| import { ZenStackClient } from '@zenstackhq/orm'; | ||
| import { PGliteDialect } from 'kysely'; | ||
|
|
||
| const db = new ZenStackClient(schema, { | ||
| dialect: new PGliteDialect({ | ||
| pglite: new PGlite(), | ||
| }), | ||
| }); | ||
| ``` |
There was a problem hiding this comment.
Add missing <AvailableSince> component per coding guidelines.
The new "Using PGlite" section introduces a documented feature but is missing the required <AvailableSince version="vX.Y.Z" /> component. According to coding guidelines, documentation files that introduce new features must include this component immediately under the heading, and the component must be imported from _components/AvailableSince.
🔧 Proposed fix
First, add the import at the top of the file (after line 5):
import PackageInstall from '../../_components/PackageInstall';
+import AvailableSince from '../../_components/AvailableSince';Then, add the component immediately under the heading (after line 30):
## Using PGlite
+
+<AvailableSince version="vX.Y.Z" />
+
:::danger No Official SupportAction required: Replace vX.Y.Z with the actual version in which PGlite dialect support was first introduced.
🧰 Tools
🪛 LanguageTool
[grammar] ~36-~36: Ensure spelling is correct
Context: ...geInstall dependencies={['@electric-sql/pglite', 'kysely']} /> ts import { schema } from './zenstack/schema'; import { PGlite } from '`@electric-sql/pglite`'; import { ZenStackClient } from '`@zenstackhq/orm`'; import { PGliteDialect } from 'kysely'; const db = new ZenStackClient(schema, { dialect: new PGliteDialect({ pglite: new PGlite(), }), });
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/recipe/databases/postgres.md` around lines 30 - 49, Add the missing
AvailableSince component for the "Using PGlite" section: import AvailableSince
from "_components/AvailableSince" near the other imports, then insert
<AvailableSince version="vX.Y.Z" /> immediately under the "Using PGlite"
heading; replace vX.Y.Z with the actual release version when PGlite dialect
support was introduced.
Source: Coding guidelines
Summary by CodeRabbit