Repository navigation
v0.3.0
VS Code Extension
pgfence now runs inside your editor. Install from the VS Code Marketplace or search "pgfence" in the Extensions panel.
- Inline diagnostics: lock modes, risk levels, and policy violations as you type
- Quick fixes: one-click safe rewrite replacements (lightbulb menu)
- Hover info: lock mode, blocked operations, and safe alternatives
- Status bar: error/warning count for the current file
The extension is a thin client that discovers @flvmnt/pgfence from your project's node_modules. One source of truth for CLI and editor.
LSP Server
New pgfence lsp command starts the Language Server Protocol server over stdio. The VS Code extension uses this, but any LSP-compatible editor can too.
New Rules
| Rule | Risk | Description |
|---|---|---|
ban-char-field |
LOW | Flag char(n)/character(n), prefer text |
prefer-identity |
LOW | Flag serial/bigserial, prefer IDENTITY (PG10+) |
drop-database |
CRITICAL | DROP DATABASE is irreversible |
ban-alter-domain-add-constraint |
HIGH | Validates against all tables using the domain |
ban-create-domain-with-constraint |
LOW | Domains with constraints have poor migration support |
Parser Improvements
- Character-level source offsets (
startOffset/endOffset) with correct UTF-8 byte-to-char conversion - Policy violations now carry
statementIndexfor precise source mapping
Stats
- 42 check patterns (up from 37)
- 306 tests (up from 286)
- 54 items across 4 risk levels on the homepage
Install
npm install -D @flvmnt/pgfence@0.3.0
code --install-extension flvmnt.pgfenceFull Changelog: v0.2.4...v0.3.0