Project

General

Profile

« Previous | Next » 

Revision 9094

lib/sh/db.sh: added set_database alias, and use it in mysql_cmd()

View differences:

lib/sh/db.sh
28 28

  
29 29
### MySQL
30 30

  
31
alias set_database=\
32
'if test "$schema"; then declare database="${database-$schema}"; fi'
33

  
34
fi # load new aliases
35
if self_being_included; then
36

  
31 37
# auto-adds connection/login opts when specified
32 38
mysql_cmd() # usage: mysql*() { ...; mysql_cmd "$@"; }
33 39
{
......
37 43
	if test "$ssh_server"; then
38 44
		local ssh_dest="${ssh_dest-${ssh_user:+$ssh_user@}$ssh_server}"
39 45
	fi
40
	if test "$schema"; then local database="${database-$schema}"; fi
46
	set_database
41 47
	
42 48
	local var=ssh_dest; local_inv
43 49
	command ${ssh_dest:+ssh "$ssh_dest" }"${FUNCNAME[1]}" \

Also available in: Unified diff