Last updated:
0 purchases
pandocrunpostgres 0.0.4
pandoc-run-postgres
Execute SQL queries inside a markdown document
Example
Write a SQL query in a code block
``` run-postgres
SELECT oid, 'hello ' || rolname || '!' AS greetings from pg_roles
Limit 2;
```
Call pandoc
export PGHOST=localhost
export PGDATABASE=foo
export PGUSER=bob
export PGPASSWORD=xxxxxxxx
pandoc --filter pandoc-run-postgres hello.md -o result.md
The output will contain the SQL query inside a SQL codeblock and
the result in a table:
```sql
SELECT oid,
'hello ' || rolname || '!' AS greetings
FROM pg_roles
LIMIT 2;
```
oid greetings
------ -----------------------------
33731 hello bob!
33748 hello alice!
Install
pip install pandoc-run-postgres
Configuration
See examples in sample.md.
Similar projects
pandoc-filter-runsql for MySQL
Jupyter's ipython-sql
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.