disabled
      10
  :   ˆl—äY>”ªe¶¥8 ]¸Û—uLZ7ÿÂƒh¹a–äY>”ªe¶¥8 _¸Ë7Ú˜´oÁ      10
  #   ˆl–ß=¿J¥!®Å ² …p.ÜêbÑ¿Ä„}ï¿Â ?÷     =head1 NAME

DBD::File::Developers - Developers documentation for DBD::File

=head1 SYNOPSIS

    package DBD::myDriver;

    use base qw( DBD::File );

    sub driver
    {
	...
	my $drh = $proto->SUPER::driver ($attr);
	...
	return $drh->{class};
	}

    sub CLONE { ... }

    package DBD::myDriver::dr;

    @ISA = qw( DBD::File::dr );

    sub data_sources { ... }
    ...

    package DBD::myDriver::db;

    @ISA = qw( DBD::File::db );

    sub init_valid_attributes { ... }
    sub init_default_attributes { ... }
    sub set_versions { ... }
    sub validate_STORE_attr { my ($dbh, $attrib, $value) = @_; ... }
    sub validate_FETCH_attr { my ($dbh, $attrib) = @_; ... }
    sub get_myd_versions { ... }

    package DBD::myDriver::st;

    @ISA = qw( DBD::File::st );

    sub FETCH { ... }
    sub STORE { ... }

    package DBD::myDriver::Statement;

    @ISA = qw( DBD::File::Statement );

    package DBD::myDriver::Table;

    @ISA = qw( DBD::File::Table );

    my %reset_on_modify = (
        myd_abc => "myd_foo",
        myd_mno => "myd_bar",
        );
    __PACKAGE__->register_reset_on_modify (\%reset_on_modify);
    my %compat_map = (
        abc => 'foo_abc',
        xyz => 'foo_xyz',
        );
    __PACKAGE__->register_compat_map (\%compat_map);

    sub bootstrap_table_meta { ... }
    sub init_table_meta { ... }
    sub table_meta_attr_changed { ... }
    sub open_data { ... }

    sub fetch_row { ... }
    sub push_row { ... }
    sub push_names { ... }

    # optimize the SQL engine by add one or more of
    sub update_current_row { ... }
    # or
    sub update_specific_row { ... }
    # or
    sub update_one_row { ... }
    # or
    sub insert_new_row { ... }
    # or
    sub delete_current_row { ... }
    # or
    sub delete_one_row { ... }

=head1 DESCRIPTION

This document describes how DBD developers can write DBD::File based DBI
drivers. It supplements L<DBI::DBD> and L<DBI::DBD::SqlEngine::Developers>,
which you should read first.

=head1 CLASSES

Each DBI driver must provide a package global C<driver> method and three
DBI related classes:

=over 4

=item DBD::File::dr

Driver package, contains the methods DBI calls indirectly via DBI
interface:

  DBI->connect ('DBI:DBM:', undef, undef, {})

  # invokes
  package DBD::DBM::dr;
  @DBD::DBM::dr::ISA = qw( DBD::File::dr );

  sub connect ($$;$$$)
  {
      ...
      }

Similar for C<< data_sources >> and C<< disconnect_all >>.

Pure Perl DBI drivers derived from DBD::File do not usually need to
override any of the methods provided through the DBD::XXX::dr package
however if you need additional initialization in the connect method
you may need to.

=item DBD::File::db

Contains the methods which are called through DBI database handles
(C<< $dbh >>). e.g.,

  $sth = $dbh->prepare ("select * from foo");
  # returns the f_encoding setting for table foo
  $dbh->csv_get_meta ("foo", "f_encoding");

DBD::File provides the typical methods required here. Developers who
write DBI drivers based on DBD::File need to override the methods C<<
set_versions >> and C<< init_valid_attributes >>.

=item DBD::File::st

Contains the methods to deal with prepared statement handles. e.g.,

  $sth->execute () or die $sth->errstr;

=back

=head2 DBD::File

This is the main package containing the routines to initialize
DBD::File based DBI drivers. Primarily the C<< DBD::File::driver >>
method is invoked, either directly from DBI when the driver is
initialized or from the derived class.

  package DBD::DBM;

  use base qw( DBD::File );

  sub driver
  {
      my ($class, $attr) = @_;
      ...
      my $drh = $class->SUPER::driver ($attr);
      ...
      return $drh;
      }

It is not necessary to implement your own driver method as long as
additional initialization (e.g. installing more private driver
methods) is not required.  You do not need to call C<< setup_driver >>
as DBD::File takes care of it.

=head2 DBD::File::dr

