Database Contrib Package<-- Contributions to this contrinb module are appreciated. Please update the contrib page at http://twiki.org/cgi-bin/view/Plugins/DatabaseContrib
Summary of ContentsThis contrib provides subroutines that come in handy when accessing a SQL database.
This contrib is used among others, by TWiki:Plugins.DBIQueryPlugin
Detailed Documentation
This plugin has its origins in Vadim Belman's excellent TWiki:Plugins.DBIQueryPlugin
This plugin uses the database independent access methods in DBI to facilitate access to the SQL database. In the following
|
Key | Description | Default | Required |
---|---|---|---|
database |
Database name on the server. | none | required |
user |
Default database account name. | none | optional |
password |
Default database account password. | none | optional |
driver |
DBI driver used to access the server, (such as mysql , sqlite , oracle ).1 |
none | required |
dsn |
Complete dsn string to be used when creating the connection. See your DBD driver documentation.![]() database and driver keys are ignored. |
none | optional |
init |
Initialization command to be sent to the database server just after the connection is initiated. | none | optional |
host |
DB server hostname. | localhost |
optional |
codepage |
Client-side codepage of this connection.2 | none | optional |
usermap |
Hash ref mapping TWiki users or groups to database accounts. See Access control below. | none | optional |
allow_do |
Additional topic-level access control support (see Access control below). | default => [qw(TWikiAdminGroup)] | optional |
1 Only MySQL support has been tested. 2 Only MySQL support provided for this feature. Support for other servers is not implemented yet.
The contrib relies on TWiki for authentication and basic access control, and the database server for enforcing security.
Database server-side access control works through mapping TWiki users into database server user accounts by means of the usermap
key in the configuration setting (see Database definition above).
usermap
.
usermap
.
user
and password
keys of the database definition.
Additional controls are possible at a topic level, if needed.
The configuration key allow_do
maps individual topics into lists of users or groups with access permission for a query executed from that topic.
The key default
is used, if a matching key cannot be found for the given topic.
In the example above, members of the TWikiAdminGroup
may perform queries onany topic; TWikiGuest
is allowed only for topic Sandbox.CommonDiscussion
.
Settings are stored as preferences variables. To reference a setting write %<plugin>_<setting>%
, e.g. %DATABASECONTRIB_DEBUG%
Note: You do not need to install anything on the browser to use this module. The following instructions are for the administrator who installs the module on the TWiki server.
DatabaseContrib.zip
in your twiki installation directory. Content: File:<-- --> ![]() | Description: |
---|---|
lib/TWiki/Contrib/DatabaseContrib/Config.spec | Configuration specification |
lib/TWiki/Contrib/DatabaseContrib.pm | Contrib Perl module |
lib/TWiki/Configure/Types/TEXT.pm | Perl module supporting text areas in configure script |
data/TWiki/DatabaseContrib.txt | Contrib topic |
savesection
script (if needed).
Author: | TWiki:Main.ThomasWeigert![]() |
Copyright: | © 2009 TWiki:Main.ThomasWeigert![]() © 2009-2011 TWiki:TWiki.TWikiContributor ![]() |
License: | GPL (GNU General Public License![]() |
Plugin Version: | 2011-05-14 |
Change History: | <-- versions below in reverse order --> |
2011-05-14: | TWikibug:Item6701![]() ![]() |
2011-03-13: | TWikibug:Item6661![]() ![]() |
2009-05-20: | Initial version |
CPAN Dependencies: | CPAN:DBI![]() |
Other Dependencies: | Libraries CPAN:DBI![]() |
Perl Version: | 5.005 |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/DatabaseContrib![]() |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/DatabaseContribDev![]() |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/DatabaseContribAppraisal![]() |
Related Topics: TWikiContribs, TWiki:Plugins.DatabasePlugin, TWiki:Plugins.DBIQueryPlugin
, TWiki:Plugins.TracQueryPlugin
, TWiki:Plugins.PeerReviewPlugin
Database Contrib Package<-- Contributions to this contrinb module are appreciated. Please update the contrib page at http://twiki.org/cgi-bin/view/Plugins/DatabaseContrib
Summary of ContentsThis contrib provides subroutines that come in handy when accessing a SQL database.
This contrib is used among others, by TWiki:Plugins.DBIQueryPlugin
Detailed Documentation
This plugin has its origins in Vadim Belman's excellent TWiki:Plugins.DBIQueryPlugin
This plugin uses the database independent access methods in DBI to facilitate access to the SQL database. In the following
|
Key | Description | Default | Required |
---|---|---|---|
database |
Database name on the server. | none | required |
user |
Default database account name. | none | optional |
password |
Default database account password. | none | optional |
driver |
DBI driver used to access the server, (such as mysql , sqlite , oracle ).1 |
none | required |
dsn |
Complete dsn string to be used when creating the connection. See your DBD driver documentation.![]() database and driver keys are ignored. |
none | optional |
init |
Initialization command to be sent to the database server just after the connection is initiated. | none | optional |
host |
DB server hostname. | localhost |
optional |
codepage |
Client-side codepage of this connection.2 | none | optional |
usermap |
Hash ref mapping TWiki users or groups to database accounts. See Access control below. | none | optional |
allow_do |
Additional topic-level access control support (see Access control below). | default => [qw(TWikiAdminGroup)] | optional |
1 Only MySQL support has been tested. 2 Only MySQL support provided for this feature. Support for other servers is not implemented yet.
The contrib relies on TWiki for authentication and basic access control, and the database server for enforcing security.
Database server-side access control works through mapping TWiki users into database server user accounts by means of the usermap
key in the configuration setting (see Database definition above).
usermap
.
usermap
.
user
and password
keys of the database definition.
Additional controls are possible at a topic level, if needed.
The configuration key allow_do
maps individual topics into lists of users or groups with access permission for a query executed from that topic.
The key default
is used, if a matching key cannot be found for the given topic.
In the example above, members of the TWikiAdminGroup
may perform queries onany topic; TWikiGuest
is allowed only for topic Sandbox.CommonDiscussion
.
Settings are stored as preferences variables. To reference a setting write %<plugin>_<setting>%
, e.g. %DATABASECONTRIB_DEBUG%
Note: You do not need to install anything on the browser to use this module. The following instructions are for the administrator who installs the module on the TWiki server.
DatabaseContrib.zip
in your twiki installation directory. Content: File: | Description: |
---|---|
data/TWiki/DatabaseContrib.txt | Contrib topic |
lib/TWiki/Contrib/DatabaseContrib.pm | Contrib Perl module |
lib/TWiki/Contrib/DatabaseContrib/Config.spec | Configuration specification |
lib/TWiki/Configure/Types/TEXT.pm | Perl module supporting text areas in configure script |
savesection
script (if needed).
Author: | TWiki:Main.ThomasWeigert![]() |
Copyright: | © 2009 TWiki:Main.ThomasWeigert![]() © 2009-2011 TWiki:TWiki.TWikiContributor ![]() |
License: | GPL (GNU General Public License![]() |
Plugin Version: | 2011-05-14 |
Change History: | <-- versions below in reverse order --> |
2011-05-14: | TWikibug:Item6701![]() ![]() |
2011-03-13: | TWikibug:Item6661![]() ![]() |
2009-05-20: | Initial version |
CPAN Dependencies: | CPAN:DBI![]() |
Other Dependencies: | Libraries CPAN:DBI![]() |
Perl Version: | 5.005 |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/DatabaseContrib![]() |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/DatabaseContribDev![]() |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/DatabaseContribAppraisal![]() |
Related Topics: TWikiContribs, TWiki:Plugins.DatabasePlugin, TWiki:Plugins.DBIQueryPlugin
, TWiki:Plugins.TracQueryPlugin
, TWiki:Plugins.PeerReviewPlugin