Last active
January 17, 2022 12:05
-
-
Save kucaahbe/c22895bcc73ff393ac0e814bdd254c8a to your computer and use it in GitHub Desktop.
rails db -p use mycli as MySQL client (shell wrapper for https://www.mycli.net/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: | |
# save this file into $HOME/bin/mysql (don't forget to make it executable) | |
# and make sure $HOME/bin is in PATH environment variable before folder where original mysql binary is located. | |
# for instance mysql binary is here: /usr/local/bin/mysql, than PATH should be like: | |
# /home/user/bin:/usr/local/bin:... | |
set -e | |
declare -a args=() | |
for arg in "$@"; do | |
# exclude unsupported --default-character-set=... option | |
[[ "$arg" =~ ^--default-character-set= ]] && continue | |
args+=("$arg") | |
done | |
exec mycli "${args[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment