diff --git a/atom b/atom index 4358cb8..d0fc6fe 100755 --- a/atom +++ b/atom @@ -458,6 +458,28 @@ InsertOrUpdate() { results="${results#* = }" echo "$results" } +Delete() { +#Delete table < where_key where_value +# [where_key where_value +# […]] + local \ + table="$1" \ + key \ + value \ + where_statement \ + results + while read key value + do + (( ${#where_statement} )) && where_statement+=( "AND" ) + if [[ $value == NULL ]] + then + where_statement+=( "$key is NULL" ) + else + where_statement+=( "$key="'"'"${value//\"/\\\"}"'"' ) + fi + done + echo "DELETE from $table WHERE ${where_statement[@]};" >&3 +} createDestinations() { for destination in ${!destinationpath[@]} @@ -496,6 +518,7 @@ getFiles() { find "$sourcepath" -type f -printf "%T@ %s %P\n" ) echo 'COMMIT;' >&3 + echo } getType() {