Revision 8992
Added by Aaron Marcuse-Kubitza over 11 years ago
MySQL_export | ||
---|---|---|
3 | 3 |
# Usage: env table=... [filter=...] self >out |
4 | 4 |
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/util.sh |
5 | 5 |
|
6 |
: "${table:?}" "${filter:=1}"
|
|
6 |
: "${table:?}" |
|
7 | 7 |
|
8 | 8 |
(cat <<EOF |
9 | 9 |
SELECT * FROM $table |
10 |
WHERE $filter |
|
10 |
${filter:+WHERE $filter} |
|
11 |
${limit:+LIMIT $limit }${offset:+OFFSET $offset} |
|
11 | 12 |
EOF |
12 | 13 |
)|echo_stdin|echo_run "time" ssh vegbiendev mysql --user=bien \ |
13 | 14 |
--password="$(cat "$top_dir"/../../config/bien_password)" --database=GBIF \ |
Also available in: Unified diff
inputs/GBIF/MySQL_export: only include WHERE clause if $filter is set. support configuring LIMIT/OFFSET.