Randy Stauner > DBIx-TableLoader-CSV > DBIx::TableLoader::CSV

Download:
DBIx-TableLoader-CSV-1.102.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 1.102   Source  

NAME ^

DBIx::TableLoader::CSV - Easily load a CSV into a database table

VERSION ^

version 1.102

SYNOPSIS ^

  my $dbh = DBI->connect(@connection_args);

  DBIx::TableLoader::CSV->new(dbh => $dbh, file => $path_to_csv)->load();

  # interact with new database table full of data in $dbh

DESCRIPTION ^

This is a subclass of DBIx::TableLoader that handles the common operations of reading a CSV file (using the powerful Text::CSV (which uses Text::CSV_XS if available)).

This module simplifies the task of transforming a CSV file into a database table. This functionality was the impetus for the parent module (DBIx::TableLoader).

In most cases simply calling load() is sufficient (see "load" in DBIx::TableLoader). The methods defined by this subclass are documented for completeness.

METHODS ^

new

Accepts all options described in "OPTIONS" in DBIx::TableLoader plus some CSV specific options.

See "OPTIONS".

get_raw_row ^

Returns $csv->getline($io).

After the last row is returned this will check "eof" in Text::CSV and croak with the message from "error_diag" in Text::CSV as described by "SYNOPSIS" in Text::CSV. (If you wish to disable this behavior you can set ignore_csv_errors => 1 in the constructor.)

default_name ^

If the name option is not provided, and the file option is, this returns the file basename.

Falls back to 'csv'.

prepare_data ^

This is called automatically from the constructor to make things as simple and automatic as possible.

OPTIONS ^

There are many options available for configuration. Options specific to this module are listed below. Also see "OPTIONS" in DBIx::TableLoader for options from the base module.

Basic usage:

Options for more customization/control:

SEE ALSO ^

SUPPORT ^

Perldoc

You can find documentation for this module with the perldoc command.

  perldoc DBIx::TableLoader::CSV

Websites

The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.

Bugs / Feature Requests

Please report any bugs or feature requests by email to bug-dbix-tableloader-csv at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-TableLoader-CSV. You will be automatically notified of any progress on the request by the system.

Source Code

https://github.com/rwstauner/DBIx-TableLoader-CSV

  git clone https://github.com/rwstauner/DBIx-TableLoader-CSV.git

AUTHOR ^

Randy Stauner <rwstauner@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2011 by Randy Stauner.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: