Giter Club home page Giter Club logo

dbix-csvdumper's Introduction

NAME

DBIx::CSVDumper - dumping database (DBI) data into a CSV.

SYNOPSIS

use DBIx::CSVDumper;
my $dbh = DBI->connect(...);
my $dumper = DBIx::CSVDumper->new(
  csv_args  => {
    binary          => 1,
    always_quote    => 1,
    eol             => "\r\n",
  },
  encoding    => 'utf-8',
);


my $sth = $dbh->prepare('SELECT * FROM item');
$sth->execute;
$dumper->dump(
  sth     => $sth,
  file    => 'tmp/hoge.csv',
);

DESCRIPTION

DBIx::CSVDumper is a module for dumping database (DBI) data into a CSV.

CONSTRUCTOR

  • new

      my $dumper = DBIx::CSVDumper->new(%args);
    

    Create new dumper object. %args is a hash with object parameters. Currently recognized keys are:

  • csv_args

      csv_args => {
        binary          => 1,
        always_quote    => 1,
        eol             => "\r\n",
      },
      (default: same as above)
    
  • encoding

      encoding => 'cp932',
      (default: utf-8)
    

METHOD

  • dump

      $dumper->dump(%args);
    

    Dump CSV file. %args is a hash with parameters. Currently recognized keys are:

  • sth

      sth => $sth
      (required)
    

    the value is a DBI::st object. execute method should be called beforehand or automatically called with DBI 1.41 or newer and no bind parameters.

  • file

      file => $file
    

    string of file name.

  • fh

      fh => $fh
    

    file handle. args file or fh is required.

  • encoding

      enocding => 'euc-jp',
      (default: $dumper->encoding)
    

    encoding.

  • csv_obj

  • encoding

AUTHOR

Masayuki Matsuki [email protected]

SEE ALSO

LICENSE

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

dbix-csvdumper's People

Contributors

songmu avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.