I think you will have to script it yourself, but it's pretty easy and fun. I will take Python here.
I like the XML-RPC Confluence interface. For this, see http://goo.gl/KCt3z . The remote methods you care about are most likely the login, getPage, setPage and / or updatePage. This skeleton will look like this:
import xmlrpclib server = xmlrpclib.Server(opts.url) conn = server.confluence1 token = conn.login(opts.username, opts.password) page = conn.getPage(token,'PageSpace',page_title) page = page + table page = conn.updatePage(token,page,update_options)
table Here are the data from the PG tables. We will build it below.
For pulling simple data from PostgreSQL, I most often use psycopg2 (also considering SQLSoup). No matter how you retrieve the data, you will get a list of strings as a dictionary. Part of the database is likely to look like this:
import psycopg2, psycopg2.extras conn = psycopg2.connect("dbname=reece") cur = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) cur.execute('SELECT * FROM sometable') rows = cur.fetchall()
Now you need to format the data. For simple things, print = operations will be performed. For more complex formatting, consider a template engine like jinja2 (http://jinja.pocoo.org/). The rendering code might look like this:
from jinja2 import Template template = Template(open(template_path).read()) table = template.render( rows = rows )
The template_path file will contain a formatting template that might look like this:
<table> <tr> <th>col header 1</th> <th>col header 2</th> </tr> {% for row in rows|sort -%} <tr> <td>{{row.col1}}</td> <td>{{row.col2}}</td> </tr> {% endfor %} </table>
Note. Confluence no longer uses default wiki markup. You must write HTML.
Finally, if you want to create a page for all tables, you can look at information_schema, which contains information about the database in the form of tables. For example:
select table_name from information_schema.tables where table_schema = current_schema();