Projects tagged ‘database’, ‘diff’, and ‘python’


Jump to tag:

Projects tagged ‘database’, ‘diff’, and ‘python’

Filtered by Project Tags database diff python

Refine results Project Tags compare (1) django (1) csv (1) evolution (1) schema-evolution (1) utilities (1) mysql (1)

[2 total ]

1 Users

This is a command line tool written in Python. It displays all the differences between two database schemas. The schema are provided as SQL dump. 1. ExampleInputdb1.sql: sql dump of a database with ... [More] a single table: 'person' CREATE TABLE `person` ( `last name` varchar(50) NOT NULL, `date_of_birth` varchar(45) NOT NULL, PRIMARY KEY (`last name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;db2.sql: sql dump of the same database after adding a new table 'car' and modified fields in the 'person' table. CREATE TABLE `car` ( `color` varchar(50) NOT NULL, `number_plate` varchar(50) NOT NULL, `brand` varchar(50) NOT NULL, PRIMARY KEY (`number_plate`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `person` ( `last name` varchar(50) NOT NULL, `date_of_birth` datetime NOT NULL, `first_name` varchar(45) NOT NULL, PRIMARY KEY (`last name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;Commandpython compdb.py db1.sql db2.sqlOutput% FIELD: person.date_of_birth `date_of_birth` varchar(45) NOT NULL => `date_of_birth` datetime NOT NULL + FIELD: person.`first_name` varchar(45) NOT NULL + TABLE: car 3 difference(s).2. Notation%: difference +: new field or table -: missing field or table 3. LimitationsCurrently works only with MySQL dumps Obviously this tool cannot detect when the name of a field or a table has changed! 4. MotivationThis script was originally written to help me keep track of the evolution of Django models (hence the Python implementation). Before upgrading a staging server, I would compare the SQL dump from my development database (generated with mysqldump -d or with python manage.py sql) with the dump from my staging server. Note that more sophisticated tools have been developed for this purpose, search for 'django schema evolution' on any search engine to find them. This tool was developed as part of a UML to Django conversion project. 5. FeedbackYour comments and contributions are welcome. [Less]
Created 7 months ago.

0 Users

Descriptionpycsvdiff is a tool for diffing comma separated value (CSV) files. DBA's may find it useful to debug data-dumps, while programmers might integrate it with an automated testing solution to ... [More] verify that data exports don't regress. FeaturesWill use field labels in diffs if specified Ability to skip fields (e.g. timestamps) using field numbers or field labels as specifiers Optional case insensitive diff Can use labels to map out-of-order columns between CSV files Variable verbosity Built-in test suite runnable with --run-tests option from command line [Less]
Created about 1 year ago.