compression is applied on sql string instead of file
Closed this issue · 2 comments
When I create a db dump using the --compress flag or enabling the compress to true from the config file the output file cannot be uncompressed successfully. I tried different apps to do it, here are the results I got
Archive Utility App
- This creates another compressed file with .cpgz as the extension. Ex: source file is db.sql.gz the extracted file from Archive Utility App will be db.sql.gz.cpgz. If I try to unzip this one it will create another file called db.sql 2.gz which will then become db.sql 2.gz.cpgz if i uncompress that again therefore becoming an infinite loop if I keep doing it
RAR Extractor Lite
- The app will crash
Keka
- Extraction failed.. will create a folder with the same name of the gz filed but is empty folder
Tools from CLI
dtrx
- dtrx: ERROR: could not handle ets_20180828105530.sql.gz
dtrx: ERROR: treating as gzip-encoded compressed file failed: decoding error: 'zcat' returned status code 1
dtrx: ERROR: Error output from this process:
zcat: unknown compression format
tar
-tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
Im running on MAC OS high sierra
this is because I have compressed the result string before saving in the file that's why you get an error when you try to decompress it. Code need some love and compress the sql file and not the sql string that will be saved on it. I'll try to find some time this weekend to work on that or if you have managed to fix it feel free to send a PR.
@isaac-manubag this is fixed on new version 4.* please check new command fix-file for more datailed usage.