NAME

DBIx::Librarian::Library::OnePerFile - one-query-per-file support class for DBIx::Librarian

SYNOPSIS

Provides repository service to DBIx::Librarian. This package supports SQL in template files, where each file contains a single query block. A query tag corresponds to a filename (tag.EXTENSION where EXTENSION is specified at initialization and defaults to ".sql"). Searching will be done through a list of directories. The first matching file will be used. Conflicts are not detected.

OnePerFile recognizes when a query file is changed, and will instruct DBIx::Librarian to reload the query.

METHODS

new
  my $archiver = new DBIx::Librarian::Library::OnePerFile
		  ({ name => "value" ... });

Supported Library::OnePerFile parameters:

LIB         Search path for SQL files.  Defaults to [ "sql" ]

EXTENSION   Filename extension for SQL files.  Defaults to ".sql"

TRACE       Turns on function tracing in this package.
new
$archiver->lookup($tag);

Returns cached statement handles. If the source has changed since it was cached, returns false.

new
$archiver->find($tag);

Searches through the directory path in LIB for a query file named "$tag.EXTENSION". Returns the contents of that file if successful, and records the path for subsequent checking by lookup().

cache
$archiver->cache($tag, $data);

Caches statement handles for later fetching via lookup().

toc
my @array = $archiver->toc();

Search through the library and return a list of all available entries. Does not import any of the items.

AUTHOR

Jason W. May <jmay@pobox.com>

COPYRIGHT

Copyright (C) 2001 Jason W. May. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 35:

'=item' outside of any '=over'

Around line 202:

You forgot a '=back' before '=head1'