Mark Lawrence > SQL-DB > SQL::DB::Schema::ARow

Download:
SQL-DB-0.18.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  1
View/Report Bugs
Source  

NAME ^

SQL::DB::Schema::ARow - description

SYNOPSIS ^

  use SQL::DB::Schema::ARow;

DESCRIPTION ^

SQL::DB::Schema::ARow is ...

METHODS ^

new

_table

_table_name

_alias

_columns

_column_names

_join($arow)

This method takes another SQL::DB::Schema::ARow object and returns an SQL::DB::Expr expression suitable for JOINing the two tables together based on their foreign key relationships. Eg:

    $db->fetch(
        select    => [$arow1->_columns],
        from      => $arow,
        left_join => $arow2,
        on        => $arow1->_join($arow2),
    );

Be aware that if there is no direct foreign key relationship between the two 'undef' will be returned and the SQL generated in this example would be invalid, producing a DBI/DBD error.

_join_columns($arow)

This method takes another SQL::DB::Schema::ARow object and returns the names of the columns of the calling object that would be used for a join. An empty list is returned if there is no foreign key relationship between the two tables.

FILES ^

SEE ALSO ^

Other

AUTHOR ^

Mark Lawrence <nomad@null.net>

COPYRIGHT AND LICENSE ^

Copyright (C) 2007,2008 Mark Lawrence <nomad@null.net>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

syntax highlighting: