mysqldumpsplitter

Version, currently 0.14 versions

github.com/nulty/mysqldumpsplitter

Extract data from MySQL dump files

3 stars
0 dependents
License: MIT

Nothing has been indexed for 0.1 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  mysqldumpsplitter:
    github: nulty/mysqldumpsplitter
    version: ~> 0.1

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.1. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

mysqldumpsplitter

Inspired by Kedarvj's shell script by the same name.

https://github.com/kedarvj/mysqldumpsplitter

Installation

Build

$ crystal build --release -o bin/mysqldumpsplitter

Usage

Help

bin/mysqldumpsplitter --help

List all the tables in a dump file

bin/mysqldumpsplitter --desc ./path/to/file.sql

Extract a single table from an *.sql dump file to .sql.gz

# Default output file is gzip compressed
bin/mysqldumpsplitter --extract TABLE --match some_table_name ./path/to/file.sql

Decompressed output file

bin/mysqldumpsplitter --extract TABLE --match some_table_name --compression none ./path/to/file.sql

Extract all tables from a dump file

bin/mysqldumpsplitter --extract ALLTABLES ./path/to/file.sql

Development

  • Single database file
    • [x] Describe tables
    • [x] Extract single table
    • [x] Extract all tables
    • [x] Compression
    • [ ] Decompression
    • [ ] Estimate table size
  • Multiple Databases in one file
    • [ ] Extract single database
    • [ ] Extract multiple databases

Contributing

  1. Fork it (https://github.com/nulty/mysqldumpsplitter/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Testing

**Build the project before running tests as some tests depend on the executable

crystal spec

Contributors

  • nulty Iain McNulty - creator, maintainer