Changes between Version 4 and Version 5 of TracSqlHelperScript


Ignore:
Timestamp:
Nov 9, 2015, 11:34:01 AM (7 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracSqlHelperScript

    v4 v5  
    55== Description
    66
    7 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.
     7While 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.
    88
    99I'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.
     
    1515
    1616If you have any issues, create a
    17 [http://trac-hacks.org/newticket?component=TracSqlHelperScript&owner=k0s new ticket].
     17[/newticket?component=TracSqlHelperScript new ticket].
    1818
    1919[[TicketQuery(component=TracSqlHelperScript&group=type,format=progress)]]
     
    2121== Download
    2222
    23 Download the zipped source from [download:tracsqlhelperscript here].
     23Download the zipped source from [export:tracsqlhelperscript here].
    2424
    2525== Source
    2626
    27 You can check out TracSqlHelperScript from [http://trac-hacks.org/svn/tracsqlhelperscript here] using Subversion, or [source:tracsqlhelperscript browse the source] with Trac.
     27You can check out TracSqlHelperScript from [/svn/tracsqlhelperscript here] using Subversion, or [source:tracsqlhelperscript browse the source] with Trac.
    2828
    2929== Example
    3030
    31 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.
     31See the GeoTicketPlugin and the TracHoursPlugin for how these functions are used. Essentially, they are 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.
    3232
    3333== Recent Changes