graze/data-db

Abstracted Database Nodes

dev-master 2016-09-27 11:00 UTC

This package is auto-updated.

Last update: 2021-12-23 23:05:40 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Library to import and export tables to/from files.

  • Supports: Pdo, Zend1, and Zend2 database adapters
  • Supports: Mysql and Redshift databases currently.

Install

Via Composer

$ composer require graze/data-db

Usage

$table1 = new Table($mysqlAdapter, 'schema', 'table');
$file = new LocalFile('/some/path/to/file');
$exporter = new TableExporter($file, new CsvFormat());
$exporter->export($table);

// file written to with the contents of $table1 in the default Csv Format

$table2 = new Table($redshiftAdapter, 'schema', 'table');
$importer = new RedshiftFileImporter($table2);
$importer->import($file);

// table2 now contains the contents of table1

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ make test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@graze.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.