$ curl -#fL "$(curl -s https://api.github.com/repos/NINEJKH/myformer/releases/latest | grep 'browser_download_url' | sed -n 's/.*"\(http.*\)".*/\1/p')" | sudo tee /usr/local/bin/myformer > /dev/null && sudo chmod +x /usr/local/bin/myformer
$ mysqldump \
--verbose \
--compress \
--no-data \
--quick \
database \
> database_structure.sql
$ mysqldump \
--verbose \
--compress \
--complete-insert \
--no-create-info \
--quick \
--hex-blob \
database \
> database_data.sql
$ cat <<'EOF' > ./myform.json
{
"table_name": {
"columnA": {
"Tel": null
},
"columnB": {
"Email": "qa+%[email protected]"
},
"columnC": {
"Set": "static content"
}
}
}
EOF
myformer transform foobar_data.sql
or via docker:
docker run -it --rm -v "${PWD}:/dumps" 9jkh/myformer transform foobar_data.sql
This will create a file with the same name + postfixed with "+transformed".
Anonymise Email addresses.
Accepts a string parameter, %s
will be replaced with the first 16 chars
of the md5 hash of the original value.
Set column value from another column value.
Accepts a string parameter, which will be used as column name of the source value.
Statically set the value of the string parameter
Random telphone-like number (999 + 10-digits)