Namespace Plugins
sqldoc uses namespace plugins to transform SQL tags into additional SQL statements. Each namespace handles a specific concern -- audit trails, row-level security, validation, documentation, and more.
Tags are written as SQL comments (-- @namespace.tag(args)) and compiled into dialect-correct SQL at build time.
Available Namespaces
@anon
PostgreSQL Anonymizer security labels
@audit
Audit namespace plugin -- generates audit triggers for Postgres, MySQL, and SQLite. Postgres: PL/pgSQL trigger function + multi-event trigger with row_to_json. MySQL: Separate per-event triggers with inline bodies using JSON_OBJECT and explicit columns. SQLite: Separate per-event triggers with inline bodies using json_object and explicit columns.
@codegen
@comment
@deprecated
@docs
@lint
@pg
PostGraphile smart comments for PostgreSQL
@rls
Row-Level Security policies for PostgreSQL
@validate
Created a plugin?
If you've built a namespace plugin for sqldoc, we'd love to list it here. Open an issue and we can add it to this page.