         tags (insert-tag-list user-hash nil edit-time args)]
     (when (and edit-time
                (<= edit-time (.getTime (java.util.Date.))))
-      (jdbc/with-connection
+      (update-or-insert!
         @spec
-        (jdbc/update-or-insert-values
-          :user
-          ["userhash = ?" user-hash]
-          {:realuserhash user-hash 
-           :userhash user-hash 
-           :title (f/b-decode-string (get args "title"))
-           :body (f/b-decode-string (get args "body"))
-           :mtime edit-time
-           :pichash (f/b-decode-bytes (get pics 0))
-           :status (f/b-decode-long (get args "status"))})
-        (jdbc/update-values
-          :user
-          ["userhash = ? AND time IS NULL" user-hash]
-          {:time (.getTime (java.util.Date.))})))))
+        :user
+        {:realuserhash user-hash 
+         :userhash user-hash 
+         :title (f/b-decode-string (get args "title"))
+         :body (f/b-decode-string (get args "body"))
+         :mtime edit-time
+         :pichash (f/b-decode-bytes (get pics 0))
+         :status (f/b-decode-long (get args "status"))}
+        ["userhash = ?" user-hash])
+      (jdbc/update!
+        @spec
+        :user
+        {:time (.getTime (java.util.Date.))}
+        ["userhash = ? AND time IS NULL" user-hash]))))
 
 (defn insert-post
   [user-hash post-time args]

  ([table-name] (check-table table-name "*"))
  ([table-name column-name]
   (try
     (jdbc/with-connection
       @spec
       (jdbc/with-query-results
         rs
         [(str "SELECT COUNT(" (name column-name) ") FROM " (name table-name))]
         rs))
     (catch Exception e nil))))

(defn create-index
  [table-name columns]
  (jdbc/do-commands
    "CREATE ALIAS IF NOT EXISTS FT_INIT FOR \"org.h2.fulltext.FullText.init\";"
    "CALL FT_INIT();"
    (format "CALL FT_CREATE_INDEX('PUBLIC', '%s', '%s');"
            table-name (clojure.string/join "," columns))))

(defn create-generic-table
  [table-name]
  (jdbc/create-table
    table-name
    [:id "BIGINT" "PRIMARY KEY AUTO_INCREMENT"]
    [:realuserhash "BINARY"]


(defn delete-user
  [user-hash]
  (jdbc/delete! @spec :user ["userhash = ?" user-hash])
  (jdbc/delete! @spec :post ["userhash = ?" user-hash])
  (jdbc/delete! @spec :pic ["userhash = ?" user-hash])
  (jdbc/delete! @spec :fav ["userhash = ?" user-hash])
  (jdbc/delete! @spec :tag ["userhash = ?" user-hash]))
