Algorithm-Dependency-Source-DBI

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

      my $simple = Algorithm::Dependency::Source::DBI->new(
          dbh            => $dbi_db_handle,
          select_ids     => 'select name from stuff',
          select_depends => 'select from, to from m2m_deps',
      );
      
  my $complex = Algorithm::Dependency::Source::DBI->new(
          dbh            => $dbi_db_handle,
          select_ids     => [ 'select name from stuff where foo = ?',         'bar' ],
          select_depends => [ 'select from, to from m2m_deps where from = ?', 'bar' ],
      );

    The "new" constructor takes three named named params.

    The "dbh" param should be a standard DBI database connection.

    The "select_ids" param is either a complete SQL string, or a reference
    to an "ARRAY" containing a SQL string with placeholders and matching
    variables.

    When executed on the database, it should return a single column
    containing the complete set of all item identifiers.

    The "select_depends" param is either a complete SQL string, or a
    reference to an "ARRAY" containing a SQL string with placeholders and
    matching variables.

    When executed on the database, it should return two columns containing
    the complete set of all dependencies, where identifiers in the
    first-column depends on identifiers in the second-column.

    Returns a new Algorithm::Dependency::Source::DBI object, or dies on
    error.

  dbh
    The "dbh" accessor returns the database handle provided to the
    constructor.

  select_ids
    The "select_ids" accessor returns the SQL statement provided to the
    constructor. If a raw string was provided, it will be returned as a
    reference to an "ARRAY" containing the SQL string and no params.

  select_depends
    The "select_depends" accessor returns the SQL statement provided to the
    constructor. If a raw string was provided, it will be returned as a
    reference to an "ARRAY" containing the SQL string and no params.

SUPPORT
    To file a bug against this module, use the CPAN bug tracking system

    <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Algorithm-Dependency-Sou
    rce-DBI>

    For other comments, contact the author.

AUTHOR
    Adam Kennedy <adamk@cpan.org>

SEE ALSO
    Algorithm::Dependency, <http://ali.as/>

COPYRIGHT
    Copyright 2007 - 2009 Adam Kennedy.

    This program is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

    The full text of the license can be found in the LICENSE file included
    with this module.



( run in 1.762 second using v1.01-cache-2.11-cpan-df04353d9ac )