WebSource::DB : For each input execute a query and return the result as output
A DB operator allows to execute a parameterized SQL query for each input. This allows, for example, to populate a database with extracted data.
A typical DB operator declaration is as follows :
<ws:database name="db" forward-to="format"> <parameters> <param name="db" value="factbook" /> <param name="user" value="username" /> <param name="pass" value="password" /> </parameters> <query> INSERT INTO country(name, population, coordinates) VALUES ('$country','$population','$coordinates') </query> </ws:database>
When the query is active (results are produced), the operator returns these results. Otherwise, the input is simply forwarded on for further treatment.
$cache = WebSource::DB->new(wsnode => $node); # for the rest it works as a WebSource::Module
Create a new DB operator;
WebSource::Module
To install WebSource, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebSource
CPAN shell
perl -MCPAN -e shell install WebSource
For more information on module installation, please visit the detailed CPAN module installation guide.