Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/recipe/databases/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,24 @@ const db = new ZenStackClient(schema, {
}),
});
```

## 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(),
}),
});
```
Comment on lines +30 to +49

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

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 Support

Action 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