Coder Social home page Coder Social logo

davydmaker / sql-dump-splitter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 5 KB

A Python tool to split large SQL dump files into smaller, manageable parts based on specific SQL conditions.

License: MIT License

Python 100.00%
file-splitter splitter sql-dump sql-tools sql-splitter

sql-dump-splitter's Introduction

SQL Dump Splitter

Description

The SQL Dump Splitter is a Python tool designed to split large SQL dump files into smaller files based on specific conditions such as 'DROP TABLE' and 'CREATE TABLE IF NOT EXISTS'. This tool is useful for managing large SQL databases where dumps can be excessively large for efficient handling.

Features

  • Splits large SQL files into multiple smaller files.
  • Supports customizable conditions to trigger a new split.
  • Option to ignore blank lines.
  • Generates a summary report of the splitting process.

Prerequisites

To use this script, you will need Python 3.6 or higher. No additional external libraries are required.

Installation

No formal installation is necessary. The script can be cloned directly from the repository and run from the command line.

git clone https://github.com/davydmaker/sql-dump-splitter.git
cd sql-dump-splitter

Usage

To use the SQL Dump Splitter, run the script from the command line with the required parameters. Here is an example of how to use the script:

python3 sql_dump_splitter.py --input-file 'path/to/your/dump.sql' --output-dir 'path/to/output' --trigger-count 1 --ignore-blank-lines --report

Arguments

  • --input-file: Path to the SQL file you want to split.
  • --output-dir: Directory where the split files will be saved. If not provided, a directory with the name of the input file is created.
  • --trigger-count: Number of occurrences of the SQL conditions before saving a file (default: 1).
  • --ignore-blank-lines: Ignore blank lines in the file (default: False).
  • --sql-conditions: List of SQL conditions that trigger the file split.
  • --report: Display a summary report at the end of the execution.

Contributing

Contributions are always welcome! If you have suggestions for improving the script or adding new features, feel free to fork the repository and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

sql-dump-splitter's People

Contributors

davydmaker avatar

Stargazers

 avatar

Watchers

 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.