A tool that enables bi-directional data synchronization between DBF (dBase) files and a SQL databases. It facilitates seamless data migration from DBF to SQL and vice versa.
- Check your Python version, we use
python = "^3.12"
:
python --version
- Clone the repository:
git clone https://github.com/joelabreurojas/DBFxSQL.git
- Install Poetry (if not alredy installed)
pip install poetry
- Set up the environment:
cd DBFxSQL
poetry shell
poetry install
- Run the tool:
python run.py # python -m dbfxsql
As a library:
- Clone the repository:
- Install the project as a Python library:
- Run the tool:
git clone https://github.com/joelabreurojas/DBFxSQL.git
cd DBFxSQL
pip install .
dbfxsql
Detailed Usage Instructions Coming Soon!
Comprehensive documentation with usage instructions and code examples will be available in a separate file shortly. Stay tuned!
Early Code Example:
This early version of the code demonstrates a basic interaction with the tool.
Link to Asciinema code example
Required:
- Detect OS to migrate.
- Handle temp files for MSSQL in Windows.
- Create Store Procedures & Triggers for MSSQL in Windows.
Desirable:
- Automate creation of temp files for any MSSQL source in Windows.
- Treat temporary files as MSSQL sources.
- Create save procedure (write_file) to update temporary files in Windows.
- Create insert/update/delete triggers for any MSSQL table in Windows.
- Handle bulk insert by single executions to detect MSSQL changes.
- Handle migration priority in configuration.
- Fix date format issues.
- Specify None type for engine data types.
- Handle db connection errors.
- Treat dbf.data_types.NullType as empty string.
- Order library imports.
- Specify types that are used throughout the project.
- Order functions by encapsulation level.
- Use alias to mitigate long types.
- Remove comparison for bulk operations.
- Create a changelog.
- Raise an error if an empty string is returned.
- Specify temporary files to listen on in configuration.
- Specify migration order into the configuration.
- Add CDC to SQL.
- Balance rows for indirect table relationships.
- Implement field target for indirect table relationships.
- Recognize indirect table relationships by their target tables.
- Balance the number of rows between indirect table relationships (large over small).
- Apply synchronization by target fields when they exist.
- Standardize automatic synchronization checks.
- Use models to pass data between forms.
- Aggregate entities like exceptions and models.
- New incremental cli workflow.
- Implement more abstraction in controllers.
- Group origin tables by destiny tables to optimize read queries during migration.
- Accept row_number conditions for DBF.
- Add FIELDS options to filter read requests.
- Configuration commands for uploading and editing.
- Validate existence of received field type.
- Validate KeyErrors for invalid fields.
- Validate type lengths and names for consistency between DBF and SQL.
- Public project documentation.
- Command Query Responsibility Segregation (CQRS) pattern implementation.
- Released as a Python library.
- Development of a GUI to manage DBF and SQL.
Improvements?
- Don't hesitate to create a PR.
Problems?
- Feel free to open a new issue!
Special thanks to the following projects for making this tool possible:
- Flask Boilerplate - Python Structure Guide by Ezequiel L. Castaño
- DBF library - Pure Python DBF reader/writer by Ethan Furman
- Watchfiles library - Simple, modern and fast file watching and code reload in Python by Samuel Colvin
- Click library - A Python command line interface toolkit by Pallets Organization