SQLEngine/Driver/XBase.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 29 CC 1 SCAR 6.9
CC
1
Cov
0%
_init
2.0
sql_detect_table
2.0
dbms_null_becomes_emptystring
2.0
CRAP 2.0
1 =head1 NAME
2  
3 DBIx::SQLEngine::Driver::XBase - Support DBD::XBase 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:XBase:my_data_path' );
10
11 B<Portability Subclasses:> Uses driver's idioms or emulation.
12
13 $hash_ary = $sqldb->fetch_select(
14 table => 'students',
15 where => { name => 'Dave' },
16 );
17  
18 =head1 DESCRIPTION
19  
20 This package provides a subclass of DBIx::SQLEngine which compensates for
21 some of DBD::XBase's idiosyncrasies.
22  
23 Note that DBD::XBase does not support the normal full range of SQL DBMS
24 functionality. Consult the documentation to understand its current limits.
25  
26 =head2 About Driver Subclasses
27  
28 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.
29  
30 =cut
31  
32 ########################################################################
33  
34 package DBIx::SQLEngine::Driver::XBase;
35  
36 use strict;
37 use Carp;
38  
39 ########################################################################
40  
41 use DBIx::SQLEngine::Driver::Trait::PerlDBLib qw( :all !sql_limit );
42  
43 use DBIx::SQLEngine::Driver::Trait::NoJoins ':all';
44  
45 use DBIx::SQLEngine::Driver::Trait::NoLimit ':all';
46  
47 sub _init {
48 (shift)->get_dbh()->{FetchHashKeyName} = 'NAME_lc';
49 }
50  
51 ########################################################################
52  
53 =head2 sql_detect_table
54  
55 $sqldb->sql_detect_table ( $tablename ) : %sql_select_clauses
56  
57 Implemented using DBD::XBase's "select * from $tablename where 1 = 0".
58  
59 =cut
60  
61 sub sql_detect_table {
62 my ($self, $tablename) = @_;
63 return ( table => $tablename )
64 }
65  
66 ########################################################################
67  
68 =head2 dbms_null_becomes_emptystring
69  
70 $sqldb->dbms_null_becomes_emptystring () : 1
71  
72 Capability Limitation: This driver does not store real null or undefined values, converting them instead to empty strings.
73  
74 =cut
75  
76 sub dbms_null_becomes_emptystring { 1 }
77  
78 ########################################################################
79  
80 =head1 SEE ALSO
81  
82 See L<DBIx::SQLEngine> for the overall interface and developer documentation.
83  
84 See L<DBIx::SQLEngine::Docs::ReadMe> for general information about
85 this distribution, including installation and license information.
86  
87 =cut
88  
89 ########################################################################
90  
91 1;