OpenCode plugin (v0.1.3) that adds a postgres_query tool for running SQL queries against a configured Postgres database. Ships TypeScript types. Requires @opencode-ai/plugin >=1.15.12. Key differentiator: tight integration with OpenCode's permission system, allowing per-query authorization. Supports read-only mode and connection string configuration. Release cadence: early development.
npm install opencode-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the Postgres plugin with a connection string, read-only mode, and permission prompt.
Set readOnly: true or restrict the database role to read-only access.
Update @opencode-ai/plugin to >=1.15.12.
Use exactly 'postgres_query' in the permission config.
Set permission.postgres_query to 'deny' if you want to block queries.
N/A
Run `npm install @opencode-ai/plugin@>=1.15.12` in your project.
Add `"connectionString": "postgres://..."` to the plugin options.
Set `"postgres_query": "allow"` in the permission config or choose 'always' in the prompt.
Ensure the plugin is correctly configured in opencode config and OpenCode is restarted.