Contents
Helper functions to abstract the Trac SQL API
Description
While there is considerable contention on the subject, I am one of those people that doesn't like to see SQL statements in python code (or C code, etc). I especially don't like it when the same basic statements are repeated all over the place. So TracSqlHelperScript is my attempt to encapsulate all of this logic in one place. These are functions I've already co-written for the TracHoursPlugin and then rewritten (some of them) for the GeoTicketPlugin. Instead of rewriting them again for yet another plugin where I want this functionality, I'm making a library out of them which hopefully I will backport to those plugins.
I'd really like a better story for this in general, like having at least some of these convenient functions on the DB cursor. But quite frankly, I'm not an SQL expert, and IMHO it would be better for Trac to completely abstract its backend, so I'll leave whatever action for those that know better and stick with this library for my purposes.
Bugs/Feature Requests
Existing bugs and feature requests for TracSqlHelperScript are here.
If you have any issues, create a new ticket.
Download
Download the zipped source from here.
Source
You can check out TracSqlHelperScript from here using Subversion, or browse the source with Trac.
Example
See the GeoTicketPlugin and the TracHoursPlugin for how these functions are used. Essentially, they're to help build new plugins with when you want to have a slightly abstracted database layer. I'd love help with this, if anyone would like to contribute.
Recent Changes
[8159] by ejucovy on 06/24/10 20:30:44
rollback previous commit; it now lives on the 0.12 branch
[8158] by ejucovy on 06/24/10 20:29:56
branch for 0.12
[8157] by ejucovy on 06/24/10 20:27:17
commit patch from #7262 - for trachours 0.12 compatibility
[6617] by k0s on 09/29/09 20:35:35
interpolate here rather than passing as a value

