Changes between Version 16 and Version 17 of SqlAlchemyQueryMacro


Ignore:
Timestamp:
Aug 20, 2015, 9:19:58 AM (9 years ago)
Author:
figaro
Comment:

Rearranged paragraphs to maintain consistency

Legend:

Unmodified
Added
Removed
Modified
  • SqlAlchemyQueryMacro

    v16 v17  
    11[[PageOutline(2-5,Contents,pullout)]]
    22
    3 = Execute an SQL query
     3= Execute an SQL query from within Trac
    44
    55== Description
    66
    7 Execute an SQL Query against a configured database displaying a formatted table of results. The macro uses [http://www.sqlalchemy.org/ SQLAlchemy], the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.
     7This plugin allows you to execute an SQL Query against a configured database displaying a formatted table of results from within Trac. The macro uses [http://www.sqlalchemy.org/ SQLAlchemy], the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.
    88
    99A previous version of this module is known as SqlQueryMacro.
     
    1717
    1818If you have any issues, create a
    19 [http://trac-hacks.org/newticket?component=SqlAlchemyQueryMacro new ticket].
     19[/newticket?component=SqlAlchemyQueryMacro new ticket].
    2020
    2121[[TicketQuery(component=SqlAlchemyQueryMacro,group=type,format=progress)]]
     
    3131SqlAlchemyQueryMacro comes with sortable tables using the [http://www.kryogenix.org/code/browser/sorttable/ sorttable] library, written in Javascript.
    3232
    33 == Example
    34 
    35 This macro can be used in one of two ways:
    36 {{{
    37 {{{
    38 #!SQL
    39 SELECT * FROM foo
    40 }}}
    41 }}}
    42 
    43 or:
    44 
    45 {{{
    46 [[SQL(SELECT * FROM foo)]]
    47 }}}
    48 
    4933== Installation
    5034
     
    5438After getting the source you will have to edit {{{ install_sqlalchemyquery.bash }}} to your needs, you can change:
    5539{{{#!ini
    56 TRAC_PATH_REPLACE="/path/to/your-trac-environment" # absolute path to your trac environment
    57 TRAC_REPLACE="your_trac_environment"               # name of your trac environment ( relative path without slashes )
    58 MAX_ROW_COUNT_REPLACE="1000"                       # maximum numbers of rows for the query result to display
    59 TABLE_BORDER_REPLACE="border=\"1\""                # set the border with of the table
     40TRAC_PATH_REPLACE = "/path/to/your-trac-environment" # absolute path to your trac environment
     41TRAC_REPLACE = "your_trac_environment"               # name of your trac environment ( relative path without slashes )
     42MAX_ROW_COUNT_REPLACE = "1000"                       # maximum numbers of rows for the query result to display
     43TABLE_BORDER_REPLACE = "border=\"1\""                # set the border with of the table
    6044}}}
    6145
    6246To install the macro:
    6347{{{#!sh
    64  tar -zxvf SqlAlchemyQuery.tar.gz
    65  cd SqlAlchemyQuery
     48tar -zxvf SqlAlchemyQuery.tar.gz
     49cd SqlAlchemyQuery
    6650--- edit install_sqlalchemyquery.bash ---
    6751./install_sqlalchemyquery.bash
     
    7660--- edit install_sqlalchemyquery.bash ---
    7761./install_sqlalchemyquery.bash
    78 
    7962}}}
    8063
    81 To enable this plugin add the following to `trac.ini`:
     64To enable this plugin add the following to your `trac.ini` file:
    8265{{{#!ini
    8366[components]
     
    9982
    10083{{{#!ini
     84[sqlalchemyquery]
    10185uri = oracle://user:password@tns
    10286}}}
     
    10589
    10690{{{#!ini
     91[sqlalchemyquery]
    10792uri = sqlite:///path/to/db
    10893}}}
    10994
    11095Restart tracd after making these changes.
     96
     97== Example
     98
     99This macro can be used in one of two ways:
     100{{{
     101{{{
     102#!SQL
     103SELECT * FROM foo
     104}}}
     105}}}
     106
     107or:
     108
     109{{{
     110[[SQL(SELECT * FROM foo)]]
     111}}}
    111112
    112113== Recent Changes