Perform SQL queries on the Trac database


The TracSQL plugin adds a "SQL" tab to the Trac project. Inside this tab, the plugin supports interacting with the project database.

Key features:

  • perform queries on the project database
  • view results as raw or formatted (and hyper-linked) output
  • export result set in CSV
  • browse the database schema

This plugin supports Trac installations with SQLite, MySQL and PostgreSQL database backends. The queries will need to be written differently according to which SQL database is being used.


See github:mrjbq7/tracsql for more details and the source code, or to report issues or request features.


You can install it with:

easy_install tracsql


It is configured in the trac.ini file by enabling and configuring:

tracsql.* = enabled

The TRAC_ADMIN permission is used to control access to the query pages.

By default, the TracSQL plugin connects to the project database. To use an external database, set the database parameter in the tracsql section of the trac.ini file to a valid database connection string:

database = sqlite:db/external.db


Some screenshots, showing a few of the features:

SQL query screen

SQL schema screen

SQL query 2 screen


Author: mrjbq7?
Maintainer: mrjbq7?

Last modified 7 months ago Last modified on Feb 5, 2016, 9:44:37 PM

Attachments (3)

Download all attachments as: .zip