Skip to content

Commit

Permalink
Item11871: minor doc updates
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/SqlGridPlugin@14885 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
KipLubliner authored and KipLubliner committed May 23, 2012
1 parent edb016d commit 5c252af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions data/System/SqlGridPlugin.txt
Expand Up @@ -38,15 +38,19 @@ This is a bit messy right now - the interface needs to be changed a bit.

All additional parameters are passed verbatim through to JQGridPlugin.

---+++ sql Parsing
---+++ SQL Parsing
If you provide an sql parameter, then the plugin will parse it and inject the following parameters.
If you have an SQL expression that's too complicated for the parser then instead of providing an sql parameter
you can set the following:
you can set the following parameters:

* fromwhere_connectorparam - the part of the SQL query after 'from'.
* columns - a comma-separated list of columns.
* col_${col}_expr_connectorparam - for each column, the sql expression for that column.

The parser assumes that the select list expressions contain balanced parentheses. So this would not work:

=select '(' || foo as bar from table1=

---++ Examples

%<nop>SQLGRID{<br/>
Expand Down
3 changes: 3 additions & 0 deletions lib/Foswiki/Plugins/SqlGridPlugin.pm
Expand Up @@ -70,6 +70,9 @@ sub initPlugin {
return 1;
}

# I experimented with caching, however it made no performance difference to my queries.
# Leaving this code in here for now just in case.
#
#use File::Spec;
#use Storable;
#
Expand Down
2 changes: 2 additions & 0 deletions lib/Foswiki/Plugins/SqlGridPlugin/SqlParser.pm
Expand Up @@ -14,6 +14,8 @@ Parses an SQL expression and returns a hashtable that contains:
* fromwhere_connectorparam - the part of the SQL query after 'from'.
* columns - a comma-separated list of columns.
* col_${col}_expr_connectorparam - for each column, the sql expression for that column.
Adapted from http://www.perl.com/pub/2006/01/05/parsing.html
=cut

sub parse {
Expand Down

0 comments on commit 5c252af

Please sign in to comment.