X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=sql%2Fbuilder.sh;h=2f0e60c384d0af4591d1ca0e7a1174f9ea1ee6ab;hb=e897a7431bbc56d982ada8bfb59b763d7369add1;hp=83843d3065b0173307b70326de0116a452ef9bce;hpb=536da22ebde5fa66e0f7524e9efc0316391f1afd;p=brisk.git diff --git a/sql/builder.sh b/sql/builder.sh index 83843d3..2f0e60c 100755 --- a/sql/builder.sh +++ b/sql/builder.sh @@ -16,6 +16,7 @@ usage () { echo " piped" echo " add [ [..]]" echo " del [ [..]]" + echo " res [ [..]]" 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" -MATCH_DROP='^drop|^alter table.* drop ' +MATCH_DROP='^drop|^alter table.* drop |^delete ' 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 ;; + "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 ;;