Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

data::phrasebook::sql::query(3pm) [debian man page]

Data::Phrasebook::SQL::Query(3pm)			User Contributed Perl Documentation			 Data::Phrasebook::SQL::Query(3pm)

NAME
Data::Phrasebook::SQL::Query - Query Extension to the SQL/DBI Phrasebook Model. SYNOPSIS
my $q = $book->query( 'find_author' ); my $q = $book->query( 'find_author', 'Dictionary' ); DESCRIPTION
An extension to the SQL class to specifically handle the DBI interface for each query requested. CONSTRUCTOR
new Not to be accessed directly, but via the parent Data::Phrasebook, by specifying the class as SQL. METHODS
sql Get/set the current "sql" statement, in a form suitable for passing straight to DBI. sth Get/set the current statement handle. args Return list of arguments that will be used as bind parameters to any placeholders. Any given arguments will replace the whole list. Returns list in list context, arrayref in scalar. order As for "args", but regarding the corresponding list of argument names. The assorted "order_XXX" methods are supported as for "args_XXX". dbh Get/set the database handle. PREPARATION
/ EXECUTING METHODS execute Executes the query. Returns the result of "DBI::execute". Any arguments are given to "order_args" with the return of that method being used as arguments to "DBI::execute". If no arguments, uses those already specified. Calls "prepare" if necessary. order_args Given a hash or hashref of keyword to value mappings, organises an array of arguments suitable for use as bind parameters in the order needed by the query itself. prepare Prepares the query for execution. This method is called implicitly in most cases so you generally don't need to know about it. rebind Rebinds any bound values. Lets one pass a scalar reference in the arguments to "order_args" and have the bound value update if the original scalar changes. This method is not needed externally to this class. DELEGATED METHODS
Any method not mentioned above is given to the statement handle. All these delegations will implicitly call "prepare". SEE ALSO
Data::Phrasebook, Data::Phrasebook::SQL. SUPPORT
Please see the README file. AUTHOR
Original author: Iain Campbell Truskett (16.07.1979 - 29.12.2003) Maintainer: Barbie <barbie@cpan.org> since January 2004. for Miss Barbell Productions <http://www.missbarbell.co.uk>. COPYRIGHT AND LICENSE
Copyright (C) 2003 Iain Truskett. Copyright (C) 2004-2010 Barbie for Miss Barbell Productions. This module is free software; you can redistribute it and/or modify it under the Artistic Licence v2. perl v5.10.1 2010-08-31 Data::Phrasebook::SQL::Query(3pm)

Check Out this Related Man Page

Data::Phrasebook::Generic(3pm)				User Contributed Perl Documentation			    Data::Phrasebook::Generic(3pm)

NAME
Data::Phrasebook::Generic - Base class for Phrasebook Models SYNOPSIS
use Data::Phrasebook; my $q = Data::Phrasebook->new( class => 'Fnerk', loader => 'XML', file => 'phrases.xml', dict => 'English', ); DESCRIPTION
This module provides a base class for phrasebook implementations. CONSTRUCTOR
new "new" takes an optional hash of arguments. Each value in the hash is given as an argument to a method of the same name as the key. This constructor should never need to be called directly as Phrasebook creation should go through the Data::Phrasebook factory. Subclasses should provide at least an accessor method to retrieve values for a named key. Further methods can be overloaded, but must retain a standard API to the overloaded method. All, or at least most, phrasebook implementations should inherit from this class. METHODS
loader Set, or get, the loader class. Uses a default if none have been specified. See Data::Phrasebook::Loader. unload Called by the file() and dict() methods when a fresh file or dictionary is specified, and reloading is required. loaded Accessor to determine whether the current dictionary has been loaded file A description of a file that is passed to the loader. In most cases, this is a file. A loader that gets its data from a database could conceivably have this as a hash like thus: $q->file( { dsn => "dbi:SQLite:dbname=bookdb", table => 'phrases', } ); That is, which loader you use determines what your "file" looks like. The default loader takes just an ordinary filename. dict Accessor to store the dictionary to be used. dicts Having instantiated the "Data::Phrasebook" object class, and using the "file" attribute as a directory path, the object can return a list of the current dictionaries available (provided the plugin supports it) as: my $pb = Data::Phrasebook->new( loader => 'Text', file => '/tmp/phrasebooks', ); my @dicts = $pb->dicts; or my @dicts = $pb->dicts( $path ); keywords Having instantiated the "Data::Phrasebook" object class, using the "dict" attribute as required, the object can return a list of the current keywords available (provided the plugin supports it) as: my $pb = Data::Phrasebook->new( loader => 'Text', file => '/tmp/phrasebooks', dict => 'TEST', ); my @keywords = $pb->keywords; or my @keywords = $pb->keywords( $dict ); Note the list will be a combination of the default and any named dictionary. However, not all Loader plugins may support the second usage. data Loads the data source, if not already loaded, and returns the data block associated with the given key. my $data = $self->data($key); This is typically only used internally by implementations, not the end user. delimiters Returns or sets the current delimiters for substitution variables. Must be a regular expression with at least one capture group. The example below shows the default ':variable' style regex. $q->delimiters( qr{ :(w+) }x ); The example below shows a Template Toolkit style regex. $q->delimiters( qr{ [% s* (w+) s* %] }x ); In addition to the delimiter pattern, an optional setting to suppress missing value errors can be passed after the pattern. If set to a true value, will turn any unmatched delimiter patterns to an empty string. SEE ALSO
Data::Phrasebook, Data::Phrasebook::Loader. SUPPORT
Please see the README file. AUTHOR
Original author: Iain Campbell Truskett (16.07.1979 - 29.12.2003) Maintainer: Barbie <barbie@cpan.org> since January 2004. for Miss Barbell Productions <http://www.missbarbell.co.uk>. COPYRIGHT AND LICENSE
Copyright (C) 2003 Iain Truskett. Copyright (C) 2004-2010 Barbie for Miss Barbell Productions. This module is free software; you can redistribute it and/or modify it under the Artistic Licence v2. perl v5.10.1 2010-08-31 Data::Phrasebook::Generic(3pm)
Man Page