Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item9808: It's been a long standing desire that we support DBI-based …
…data stores. Well, this is a big step on the road. This contrib implements query and search algorithms using SQL, searching a database cache of the topics stored in RCS. Status is experimental; you are all invited to contribute to further development git-svn-id: http://svn.foswiki.org/trunk/DBIStoreContrib@9533 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
- Loading branch information
CrawfordCurrie
authored and
CrawfordCurrie
committed
Oct 7, 2010
0 parents
commit 5087137
Showing
10 changed files
with
1,099 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
---+!! !DBIStoreContrib | ||
<!-- | ||
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION% | ||
--> | ||
%SHORTDESCRIPTION% | ||
|
||
%TOC% | ||
|
||
*This extension will *not* work with Foswiki 1.1.x or earlier.* | ||
|
||
This extension (currently) implements search operations (query and text search) using [[http://www.sqlite.org/][SQLite]], the popular lightweight implementation of an SQL relational database. It uses the special cache hooks recently added to the Foswiki RCS store to cache topics in the database, and executes %<nop>SEARCH= using SQL. We get over the fact that SQL does not implement all the query search features of Foswiki by _hoisting_ SQL expressions out of the Foswiki search statements, leaving behind only those parts of the expression that SQL can't handle. | ||
|
||
*If you are experienced with SQLite and / or other SQL DMBS, you are invited with open arms to contribute to the further development of this extension.* | ||
|
||
The extension is currently classed as experimental because it has a number of problems: | ||
1 The SQL schema (and the query generator) are (probably) sub-optimal, and require extensive tuning. | ||
1 SQLite is fine for small data, but does not scale well. Large data requires use of an industrial strength DB (such as MySQL) instead. | ||
|
||
The longer term goal is to implement a full back-end store using an SQL RDBMS, rather than just a simple cache as at present. | ||
|
||
Mapping to another DB *should* be as simple as setting up a different | ||
DSN, but life is never that simple. Not all DBs imlpement the REGEXP | ||
operator, for example. Please go ahead and try, though. | ||
|
||
---++ Installation Instructions | ||
|
||
%$INSTALL_INSTRUCTIONS% | ||
* Go to =configure= and set a destination | ||
|
||
---++ Info | ||
|
||
| Author(s): | Crawford Currie http://c-dot.co.uk | | ||
| 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/DBIStoreContrib | | ||
| Support: | http://foswiki.org/bin/view/Support/DBIStoreContrib | | ||
|
||
<!-- Do _not_ attempt to edit this topic; it is auto-generated. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# See bottom of file for license and copyright information. | ||
package Foswiki::Contrib::DBIStoreContrib; | ||
|
||
use strict; | ||
|
||
our $VERSION = '$Rev$'; # version of *this file*. | ||
|
||
our $RELEASE = '1.0'; | ||
|
||
our $SHORTDESCRIPTION = '(Experimental) use of DBI to implement an SQL query search'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#--+ Extensions | ||
#--++ DBIStoreContrib | ||
# **STRING 120** | ||
# DBI DSN to use to connect to the database. | ||
$Foswiki::cfg{Extensions}{DBIStoreContrib}{DSN} = 'dbi:SQLite:dbname=$Foswiki::cfg{WorkingDir}/dbcache'; | ||
# **STRING 80** | ||
# Username to use to connect to the database. | ||
$Foswiki::cfg{Extensions}{DBIStoreContrib}{Username} = ''; | ||
# **STRING 80** | ||
# Password to use to connect to the database. | ||
$Foswiki::cfg{Extensions}{DBIStoreContrib}{Password} = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Dependencies for DBIStoreContrib | ||
# Example: | ||
# Time::ParseDate,>=2003.0211,cpan,Required. | ||
# Foswiki::Plugins,>=1.2,perl,Requires version 1.2 of handler API. | ||
|
Oops, something went wrong.