Project

General

Profile

« Previous | Next » 

Revision 8790

lib/runscripts/local.run: added log_sql (). mysql (): don't echo SQL commands when not in verbose mode. this is needed to support commands that use the query result in a $() expression, and should not have echoed commands cluttering up stdout. (unfortunately, the SQL commands are echoed to stdout rather than stderr.)

View differences:

local.run
9 9

  
10 10
export PATH="$bin_dir:$PATH"
11 11

  
12
log_sql () { test "$verbosity" -ge 2; }
13

  
12 14
mysql ()
13 15
{
14 16
	echo_func "$@"
......
25 27
	fi
26 28
	: "${dir:=$top_dir}"
27 29
	
30
	local psql_cmd="psql_$(if log_sql; then echo verbose; else echo script; fi)_vegbien"
28 31
	(cat <<EOF
29 32
\cd $dir
30 33
\set schema "$schema"
......
33 36
SET search_path TO "$schema", util;
34 37
EOF
35 38
	cat)|
36
	echo_run env no_search_path=1 psql_verbose_vegbien "$@"
39
	echo_run env no_search_path=1 "$psql_cmd" "$@"
37 40
}
38 41

  
39 42
fi

Also available in: Unified diff