projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add res[et] command to sql/builder.sh script with del+ins commands integrated in...
[brisk.git]
/
sql
/
builder.sh
diff --git
a/sql/builder.sh
b/sql/builder.sh
index
83843d3
..
2f0e60c
100755
(executable)
--- a/
sql/builder.sh
+++ b/
sql/builder.sh
@@
-16,6
+16,7
@@
usage () {
echo " piped"
echo " add <filesql> [<filesql2> [..]]"
echo " del <filesql> [<filesql2> [..]]"
echo " piped"
echo " add <filesql> [<filesql2> [..]]"
echo " del <filesql> [<filesql2> [..]]"
+ echo " res <filesql> [<filesql2> [..]]"
echo " dump [dumpfile]"
echo " dumpall [dumpfile]"
echo " all"
echo " dump [dumpfile]"
echo " dumpall [dumpfile]"
echo " all"
@@
-101,7
+102,7
@@
test "$DBUSER" != "" && pg_args="$pg_args -U $DBUSER"
test "$DBPORT" != "" && pg_args="$pg_args -p $DBPORT"
test "$DBBASE" != "" && pg_args="$pg_args $DBBASE"
test "$DBPORT" != "" && pg_args="$pg_args -p $DBPORT"
test "$DBBASE" != "" && pg_args="$pg_args $DBBASE"
-MATCH_DROP='^drop|^alter table.* drop '
+MATCH_DROP='^drop|^alter table.* drop
|^delete
'
case $CMD in
"create")
case $CMD in
"create")
@@
-151,6
+152,9
@@
case $CMD in
"del")
( echo "-- MESG: del start" ; cat "$@" | egrep -i "$MATCH_DROP" | tac ; echo "-- MESG: del end" ; ) | sqlexe
;;
"del")
( echo "-- MESG: del start" ; cat "$@" | egrep -i "$MATCH_DROP" | tac ; echo "-- MESG: del end" ; ) | sqlexe
;;
+ "res")
+ ( echo "-- MESG: res start" ; cat "$@" | egrep -i "$MATCH_DROP" | tac ; cat "$@" | egrep -iv "$MATCH_DROP" ; echo "-- MESG: del end" ; ) | sqlexe
+ ;;
"help"|"-h"|"--help")
usage 0
;;
"help"|"-h"|"--help")
usage 0
;;