id = "mysql" name = "MySQL" homepage = "https://dev.mysql.com/doc/refman/8.4/en/mysql.html" description = "mysql is a simple SQL shell with input line editing capabilities." icon = "SimpleIcons:mysql" executables = ["mysql"] [dotfiles] # https://dev.mysql.com/doc/refman/8.4/en/option-files.html — the two # user-level option files are "~/.my.cnf User-specific options" and # "~/.mylogin.cnf User-specific login path options (clients only)". The same # page puts .mylogin.cnf "in the %APPDATA%\MySQL directory on Windows and in # the current user's home directory on non-Windows systems". ~/.my.cnf is # listed for Unix only; the Windows option files (%WINDIR%\my.ini, C:\my.ini, # INSTALLDIR\my.ini) are system-wide, so they are not here. paths = ["~/.my.cnf"] # The client history: every statement typed at the mysql prompt, which is where # an ad-hoc CREATE USER ... IDENTIFIED BY lands. exclude = ["~/.mysql_history"] # https://dev.mysql.com/doc/refman/8.4/en/mysql-config-editor.html — a login # path is "an option group that permits only certain options: host, user, # password, port and socket", written obfuscated by mysql_config_editor. The # whole file exists to hold credentials. # # The fixture copies are plain text stand-ins: the real file is a binary blob # no fixture can carry, and nothing parses a whole-file secret. secret = [ "~/.mylogin.cnf", "%APPDATA%/MySQL/.mylogin.cnf", ] # Read once at client startup by a process that then exits. side_effect = false # The docs' own example of ~/.my.cnf is a [client] group with # password="my password" in it — a plaintext password in an otherwise ordinary # INI of client preferences (prompt, pager, default-character-set), so the file # is synced and this one key is lifted out. [[dotfiles.secret_paths]] file = "~/.my.cnf" match = { prefix = ["password"] } # socket names the Unix socket file the local server listens on — /tmp/mysql.sock # on one machine, /var/run/mysqld/mysqld.sock on the next. # Which path the socket sits at is decided by the packaging for this kind of # machine, so the value holds across every box of the same OS and architecture. [[dotfiles.machine_lines]] file = "~/.my.cnf" match = { prefix = ["socket"] } scope = "platform" [commands] format = 1 label = "Connect to a server" description = "Open the mysql client or run one statement. Passwords are left out; use -p at the prompt, a login path or an option file. SSL and compression tuning are left out." quality = "ai-draft" base = "fig:mysql" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/mysql.ts" license = "MIT" [[commands.field]] id = "host" label = "Host" type = "string" option = ["--host", "-h"] sources = ["fig"] [[commands.field]] id = "port" label = "Port" type = "integer" option = ["--port", "-P"] sources = ["fig"] [[commands.field]] id = "user" label = "User" type = "string" option = ["--user", "-u"] sources = ["fig"] [[commands.field]] id = "database" label = "Database" type = "string" option = ["--database", "-D"] sources = ["fig"] [[commands.field]] id = "execute" label = "Execute statement and quit" type = "string" option = ["--execute", "-e"] sources = ["fig"] [[commands.field]] id = "login_path" label = "Login path" type = "string" option = ["--login-path"] sources = ["fig"] [[commands.field]] id = "protocol" label = "Protocol" type = "string" option = ["--protocol"] suggestions = [{ value = "TCP", label = "TCP" }, { value = "SOCKET", label = "SOCKET" }, { value = "PIPE", label = "PIPE" }, { value = "MEMORY", label = "MEMORY" }] sources = ["fig"] [[commands.field]] id = "table" label = "Tabular output" type = "boolean" option = ["--table", "-t"] sources = ["fig"] [[commands.field]] id = "vertical" label = "Vertical output" type = "boolean" option = ["--vertical", "-E"] sources = ["fig"] [[commands.field]] id = "batch" label = "Batch mode" type = "boolean" option = ["--batch", "-B"] sources = ["fig"] [[commands.field]] id = "skip_column_names" label = "Skip column names" type = "boolean" option = ["--skip-column-names", "-N"] sources = ["fig"] [[commands.field]] id = "force" label = "Continue after SQL errors" type = "boolean" option = ["--force", "-f"] sources = ["fig"] [[commands.field]] id = "safe_updates" label = "Safe updates" type = "boolean" option = ["--safe-updates", "-U"] sources = ["fig"] [[commands.field]] id = "charset" label = "Default character set" type = "string" option = ["--default-character-set"] sources = ["fig"] [[commands.task]] id = "connect" label = "Connect" fields = ["host", "port", "user", "database"] required = [] [[commands.task]] id = "query" label = "Run one statement" fields = ["host", "user", "database", "execute", "table"] required = ["execute"] [[commands.group]] id = "basic" label = "Basic" fields = ["host", "port", "user", "database", "execute"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["login_path", "protocol", "table", "vertical", "batch", "skip_column_names", "force", "safe_updates", "charset"]