| 1 | =head1 NAME | ||
| 2 | |||
| 3 | DBIx::SQLEngine::Driver::AnyData - Support DBD::AnyData driver | ||
| 4 | |||
| 5 | =head1 SYNOPSIS | ||
| 6 | |||
| 7 | B<DBI Wrapper>: Adds methods to a DBI database handle. | ||
| 8 | |||
| 9 | my $sqldb = DBIx::SQLEngine->new( 'dbi:AnyData:test' ); | ||
| 10 | |||
| 11 | B<Portability Subclasses:> Uses driver's idioms or emulation. | ||
| 12 | |||
| 13 | $hash_ary = $sqldb->fetch_select( | ||
| 14 | table => 'students' | ||
| 15 | limit => 5, offset => 10 | ||
| 16 | ); | ||
| 17 | |||
| 18 | =head1 DESCRIPTION | ||
| 19 | |||
| 20 | This package provides a subclass of DBIx::SQLEngine which compensates for DBD::AnyData's idiosyncrasies. | ||
| 21 | |||
| 22 | =head2 About Driver Subclasses | ||
| 23 | |||
| 24 | You do not need to use this package directly; when you connect to a database, the SQLEngine object is automatically re-blessed in to the appropriate subclass. | ||
| 25 | |||
| 26 | =cut | ||
| 27 | |||
| 28 | ######################################################################## | ||
| 29 | |||
| 30 | package DBIx::SQLEngine::Driver::AnyData; | ||
| 31 | |||
| 32 | use strict; | ||
| 33 | use Carp; | ||
| 34 | |||
| 35 | ######################################################################## | ||
| 36 | |||
| 37 | use DBIx::SQLEngine::Driver::Trait::PerlDBLib ':all'; | ||
| 38 | |||
| 39 | ######################################################################## | ||
| 40 | |||
| 41 | =head2 sql_detect_table | ||
| 42 | |||
| 43 | $sqldb->sql_detect_table ( $tablename ) : %sql_select_clauses | ||
| 44 | |||
| 45 | Implemented using AnyData's "select * from $tablename limit 1". | ||
| 46 | |||
| 47 | =cut | ||
| 48 | |||
| 49 | sub sql_detect_table { | ||
| 50 | my ($self, $tablename) = @_; | ||
| 51 | return ( table => $tablename, limit => 1 ) | ||
| 52 | } | ||
| 53 | |||
| 54 | ######################################################################## | ||
| 55 | |||
| 56 | =head2 ad_catalog | ||
| 57 | |||
| 58 | $ds->ad_catalog( $table_name, $any_data_format, $file_name ); | ||
| 59 | |||
| 60 | Uses AnyData's 'ad_catalog' function to map in a new data file. | ||
| 61 | |||
| 62 | =cut | ||
| 63 | |||
| 64 | # $ds->ad_catalog('TableName', 'AnyDataFormat', 'FileName'); | ||
| 65 | sub ad_catalog { | ||
| 66 | (shift)->func( @_, 'ad_catalog' ); | ||
| 67 | } | ||
| 68 | |||
| 69 | ######################################################################## | ||
| 70 | |||
| 71 | =head2 recoverable_query_exceptions | ||
| 72 | |||
| 73 | $sqldb->recoverable_query_exceptions() : @common_error_messages | ||
| 74 | |||
| 75 | Provides a list of error messages which represent common | ||
| 76 | communication failures or other incidental errors. | ||
| 77 | |||
| 78 | =cut | ||
| 79 | |||
| 80 | sub recoverable_query_exceptions { | ||
| 81 | 'resource', | ||
| 82 | } | ||
| 83 | |||
| 84 | ######################################################################## | ||
| 85 | |||
| 86 | =head1 SEE ALSO | ||
| 87 | |||
| 88 | See L<DBIx::SQLEngine> for the overall interface and developer documentation. | ||
| 89 | |||
| 90 | See L<DBIx::SQLEngine::Docs::ReadMe> for general information about | ||
| 91 | this distribution, including installation and license information. | ||
| 92 | |||
| 93 | =cut | ||
| 94 | |||
| 95 | ######################################################################## | ||
| 96 | |||
| 97 | 1; |