The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Konstrukt::Plugin::sql - Perform SQL queries. Usually combined with templates to display the results.

SYNOPSIS

SELECT queries

Usage:

        <!-- put query results into a template using the dbi default settings defined in your konstrukt.settings
             see the Konstrukt::DBI documentation for the configuration of the default settings -->
        <& sql template="list_layout.template" &>
                SELECT * FROM some_table
        <& / &>
        <!-- you must have a list <+@ sql @+> in your template file to which the results are passed.
             the fields inside the list should be named like the columns in your query. -->

or

        <!-- but you may also define the listname yourself -->
        <& sql template="list_layout.template" list="some_list_name" &>
                SELECT * FROM some_table
        <& / &>
        <!-- then you should have a list <+@ some_list_name @+> in your template file. -->

or

        <!-- using custom connection settings -->
        <& sql template="..." source="dbi_dsn" user="username" pass="password" &>
                ...
        <& / &>

Other queries

        <!-- some query that won't return result data -->
        <& sql &>DELETE FROM some_table WHERE id=23<& / &>

DESCRIPTION

This plugin allows an easy integration of SQL queries. Usually combined with templates to display the results.

The usage is explained in the "SYNOPSIS".

Warning: The result will not be HTML escaped automatically.

METHODS

execute_again

Yes, this plugin may return dynamic nodes (i.e. template nodes).

prepare

SQL-queries are very volatile data. We don't want to cache it...

Parameters:

  • $tag - Reference to the tag (and its children) that shall be handled.

execute

Put out the date.

Parameters:

  • $tag - Reference to the tag (and its children) that shall be handled.

AUTHOR

Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.

This document is free software. It is distributed under the same terms as Perl itself.

SEE ALSO

Konstrukt::Plugin, Konstrukt