If I have [multiple] .sql dump files, is there a command or tool that would allow me to see a preview of the file ?

e.g: db-preview backup.sql

    tables (40)
    - users (1200)
    - articles (450)

For MySQL and PostgreSQL at least, database dump files are just text files full of SQL commands. So you can use the usual command line tools to get some idea of the contents. For example

grep 'CREATE TABLE' dump.sql | wc -l

to count how many tables are created. Not as slick as what you're hoping to find, of course.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.