Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/songmu/p5-dbix-csvdumper
https://github.com/songmu/p5-dbix-csvdumper
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/songmu/p5-dbix-csvdumper
- Owner: Songmu
- License: other
- Created: 2012-06-17T12:14:54.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-08-13T13:16:20.000Z (over 11 years ago)
- Last Synced: 2024-11-06T01:02:37.137Z (2 months ago)
- Language: Perl
- Size: 133 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# 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
# SEE ALSO
# LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.