Front page | perl.dbi.changes |
Postings from December 2012
[svn:dbi] r15530 - dbi/branches/sqlengine/lib/DBD
From:
REHSACK
Date:
December 20, 2012 10:50
Subject:
[svn:dbi] r15530 - dbi/branches/sqlengine/lib/DBD
Message ID:
20121220104954.287BF184BB2@xx12.develooper.com
Author: REHSACK
Date: Thu Dec 20 02:49:54 2012
New Revision: 15530
Modified:
dbi/branches/sqlengine/lib/DBD/File.pm
Log:
tidy examples in pod as Tux would write the code
Modified: dbi/branches/sqlengine/lib/DBD/File.pm
==============================================================================
--- dbi/branches/sqlengine/lib/DBD/File.pm (original)
+++ dbi/branches/sqlengine/lib/DBD/File.pm Thu Dec 20 02:49:54 2012
@@ -939,19 +939,15 @@
affected table has been created in this session. Valid after
C<< $sth->execute >>; undef for non-select statements.
-=head3 The following DBI attributes and methods are not supported:
+=head3 Unsupported DBI attributes and methods
-=over 4
-
-=item bind_param_inout
+=head4 bind_param_inout
-=item CursorName
+=head4 CursorName
-=item LongReadLen
+=head4 LongReadLen
-=item LongTruncOk
-
-=back
+=head4 LongTruncOk
=head3 DBD::File specific attributes
@@ -1115,7 +1111,37 @@
C<csv_tables> for L<DBD::CSV>, C<ad_tables> for L<DBD::AnyData> and
C<dbm_tables> for L<DBD::DBM>.
-=head3 Internally private attributes to deal with SQL backends:
+=head3 New opportunities for attributes from DBI::DBD::SqlEngine
+
+=head4 sql_table_source
+
+C<< $dbh->{sql_table_source} >> can be set to
+I<DBD::File::TableSource::FileSystem> (and is the default setting
+of DBD::File). This provides usual behaviour of previous DBD::File
+releases on
+
+ @ary = DBI->data_sources($driver);
+ @ary = DBI->data_sources($driver, \%attr);
+
+ @ary = $dbh->data_sources();
+ @ary = $dbh->data_sources(\%attr);
+
+ @names = $dbh->tables( $catalog, $schema, $table, $type );
+
+ $sth = $dbh->table_info( $catalog, $schema, $table, $type );
+ $sth = $dbh->table_info( $catalog, $schema, $table, $type, \%attr );
+
+ $dbh->func( "list_tables" );
+
+=head4 sql_data_source
+
+C<< $dbh->{sql_data_source} >> can be set to either
+I<DBD::File::DataSource::File>, which is default and provides the
+well known behavior of DBD::File releases prior to 0.41, or
+I<DBD::File::DataSource::Stream>, which reuses already opened
+file-handle for operations.
+
+=head3 Internally private attributes to deal with SQL backends
Do not modify any of these private attributes unless you understand
the implications of doing so. The behavior of DBD::File and derived
@@ -1158,17 +1184,6 @@
my ($drh) = DBI->install_driver ("CSV");
my (@list) = $drh->data_sources (f_dir => "/usr/local/csv_data");
-=head4 list_tables
-
-This method returns a list of file names inside $dbh->{f_dir}.
-Example:
-
- my ($dbh) = DBI->connect ("dbi:CSV:f_dir=/usr/local/csv_data");
- my (@list) = $dbh->func ("list_tables");
-
-Note that the list includes all files contained in the directory, even
-those that have non-valid table names, from the view of SQL.
-
=head3 Additional methods
The following methods are only available via their documented name when
@@ -1180,11 +1195,10 @@
Signature:
- sub f_versions (;$)
- {
- my ($table_name) = @_;
- $table_name ||= ".";
- ...
+ sub f_versions (;$) {
+ my ($table_name) = @_;
+ $table_name ||= ".";
+ ...
}
Returns the versions of the driver, including the DBI version, the Perl
@@ -1192,13 +1206,14 @@
of the SQL engine in use.
my $dbh = DBI->connect ("dbi:File:");
- my $f_versions = $dbh->f_versions ();
+ my $f_versions = $dbh->func( "f_versions" );
print "$f_versions\n";
__END__
- # DBD::File 0.39 using SQL::Statement 1.28
- # DBI 1.612
- # OS netbsd (5.99.24)
- # Perl 5.010001 (x86_64-netbsd-thread-multi)
+ # DBD::File 0.41 using IO::File (1.16)
+ # DBI::DBD::SqlEngine 0.05 using SQL::Statement 1.406
+ # DBI 1.623
+ # OS darwin (12.2.1)
+ # Perl 5.017006 (darwin-thread-multi-ld-2level)
Called in list context, f_versions will return an array containing each
line as single entry.
@@ -1207,65 +1222,6 @@
version information related to the table (e.g. DBD::DBM provides storage
backend information for the requested table, when it has a table name).
-=head4 f_get_meta
-
-Signature:
-
- sub f_get_meta ($$)
- {
- my ($table_name, $attrib) = @_;
- ...
- }
-
-Returns the value of a meta attribute set for a specific table, if any.
-See L<f_meta> for the possible attributes.
-
-A table name of C<"."> (single dot) is interpreted as the default table.
-This will retrieve the appropriate attribute globally from the dbh.
-This has the same restrictions as C<< $dbh->{$attrib} >>.
-
-=head4 f_set_meta
-
-Signature:
-
- sub f_set_meta ($$$)
- {
- my ($table_name, $attrib, $value) = @_;
- ...
- }
-
-Sets the value of a meta attribute set for a specific table.
-See L<f_meta> for the possible attributes.
-
-A table name of C<"."> (single dot) is interpreted as the default table
-which will set the specified attribute globally for the dbh.
-This has the same restrictions as C<< $dbh->{$attrib} = $value >>.
-
-=head4 f_clear_meta
-
-Signature:
-
- sub f_clear_meta ($)
- {
- my ($table_name) = @_;
- ...
- }
-
-Clears the table specific meta information in the private storage of the
-dbh.
-
-=head1 SQL ENGINES
-
-DBD::File currently supports two SQL engines: L<SQL::Statement|SQL::Statement>
-and L<DBI::SQL::Nano::Statement_|DBI::SQL::Nano>. DBI::SQL::Nano supports a
-I<very> limited subset of SQL statements, but it might be faster for some
-very simple tasks. SQL::Statement in contrast supports a much larger subset
-of ANSI SQL.
-
-To use SQL::Statement, you need at least version 1.28 of
-SQL::Statement and the environment variable C<DBI_SQL_NANO> must not
-be set to a true value.
-
=head1 KNOWN BUGS AND LIMITATIONS
=over 4
-
[svn:dbi] r15530 - dbi/branches/sqlengine/lib/DBD
by REHSACK