A Flask-based web application for merging SQLite databases. This tool helps you copy tables and data between production and development databases while preserving constraints and schema information.
- Database Comparison: View tables from source and destination databases side-by-side
- Schema Inspection: View detailed table information including:
- Column definitions (name, type, constraints)
- Primary keys
- Foreign keys
- Indexes
- Full CREATE TABLE schema
- Structure Copying: Copy table structure (schema) from source to destination
- Data Copying: Copy table data with two modes:
- Replace: Delete existing data and insert new data
- Append: Add data to existing records
- Constraint Detection: Automatically identifies constraints that need to be copied
- Data Preview: View first 100 rows of any table
- Install dependencies:
pip install -r requirements.txt- Create database directories (already created):
databases/
source/ # Place source databases here
destination/ # Place destination databases here
- Start the Flask application:
python app.py-
Open your browser to
http://localhost:5000 -
Place your SQLite databases in the appropriate directories:
- Source databases →
databases/source/ - Destination databases →
databases/destination/
- Source databases →
-
Use the web interface to:
- Select source and destination databases
- Choose tables to merge
- View table information and constraints
- Copy structure and/or data
- Select Databases: Choose source and destination databases from dropdowns
- Choose Table: Select a table from the source database
- Review Info: Examine table structure, constraints, and row count
- Copy Structure: If the table doesn't exist in destination, copy the structure first
- Copy Data: Choose replace or append mode and copy the data
GET /api/databases- List available databasesGET /api/tables/<db_type>/<db_name>- List tables in a databaseGET /api/table-info/<db_type>/<db_name>/<table_name>- Get table schema and constraintsGET /api/table-data/<db_type>/<db_name>/<table_name>- Get table data (max 100 rows)POST /api/copy-structure- Copy table structurePOST /api/copy-data- Copy table data
- Confirmation prompts before destructive operations
- Clear indication of replace vs. append modes
- Constraint validation before data copying
- Row count display to understand data volume
- Backend: Flask, Python, SQLite3
- Frontend: Tailwind CSS, DaisyUI, Vanilla JavaScript
- Database: SQLite
- The tool works by reading databases from separate directories (not loading into memory)
- Foreign key constraints are displayed but must be satisfied in the destination database
- Indexes are created automatically when copying structure
- Maximum 100 rows are displayed in data preview (all rows are copied during merge)