blob: 2cc04cd92359e6d69c889d5c4aa7d76ef6e14861 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#! /usr/bin/env bash
# file : build/mysql/pgsql
# author : Constantin Michael <constantin@codesynthesis.com>
# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
# license : GNU GPL v2; see accompanying LICENSE file
#
# PostgreSQL driver wrapper.
#
while [ $# -gt 0 ]; do
case $1 in
--driver)
driver=$2
shift 2
;;
--user)
opt="$opt --user=$2"
shift 2
;;
--dbname)
opt="$opt --dbname=$2"
shift 2
;;
--host)
opt="$opt --host=$2"
shift 2
;;
--port)
opt="$opt --port=$2"
shift 2
;;
*)
break
;;
esac
done
if [ -z "$driver" ]; then
driver=psql
fi
if [ -n "$1" ]; then
exec $driver $opt <$1
else
exec $driver $opt
fi
|