-
Notifications
You must be signed in to change notification settings - Fork 0
/
SqlGridPlugin.txt
95 lines (67 loc) · 3.14 KB
/
SqlGridPlugin.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!--
PLEASE DO NOT EDIT THIS TOPIC
It is automatically generated from the subversion repository, and any changes
you make will simply be overwritten the next time a release is generated.
Instead, you could check your fix in, raise a bug in the Bugs web, or mail the author.
-->
---+!! <nop>%TOPIC%
%TOC%
---++ Description
This plugin lets you build grids to access SQL databases. Just provide a normal SQL query and
this plugin will build a grid with paging and column sorting abilities.
You can also setup CRU<strike>D</strike> capabilities, if your grid is just on one table.
---++ Usage
%<nop>SQLGRID{ sql=" ... " }%
* =connector="mysql"= Name of the JQGridPlugin gridconnector class to use.
* =dbconn="gothams"= The DB connection specified in the SqlPlugin configuration.
* =idcol="plid"= The 'primary key' column in your query. You must have one.
* =sql="select ... from ... where ..."= An SQL statement.
In addition, the following parameters can be used for CRU<strike>D</strike> capabilities.
* =table="player"= The name of the table for insert or update.
* =editform="..."= A URL to generate the form for updates.
* =addform="..."= A URL to generate the form for inserts.
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
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 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/>
connector="mysql"<br/>
dbconn="gothams"<br/>
idcol="plid"<br/>
sql="select plid, pl_team, tm_name, pl_nickname, pl_firstname, pl_lastname from player, team where pl_team = tmid"<br/>
plid_hidden="on"<br/>
pl_team_hidden="on"<br/>
tm_name_title="Team"<br/>
pl_nickname_title="Nickname"<br/>
pl_firstname_title="First Name"<br/>
pl_lastname_title="Last Name"<br/>
rows="5"<br/>
filterbar="on"<br/>
toolbar="on"<br/>
pager="on"<br/>
width="auto"<br/>
height="auto"<br/>
}%
---++ Installation Instructions
%$INSTALL_INSTRUCTIONS%
---++ Info
Many thanks to the following sponsors for supporting this work:
* Acknowledge any sponsors here
| Author(s): | |
| Copyright: | © |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order --> |
| Dependencies: | %$DEPENDENCIES% |
| Home page: | http://foswiki.org/bin/view/Extensions/SqlGridPlugin |
| Support: | http://foswiki.org/bin/view/Support/SqlGridPlugin |
<!-- Do _not_ attempt to edit this topic; it is auto-generated. -->