   ))
 
 
-;zzz
+
 ; ----------------------------------------------------------------
 ; Whenever a record changes an entry is added to the real time log
 ; which is processed here. It first finds which queries it




;zzz
;(defn !savecode [{:keys [id] } code]
(defn !savecode [{:keys [id   code   app-session-id] }]
  (do



(defn get-schema-name-for-session-id [data-session-id]
  (let [
         app-schema-id     (:appshare_application_schema_id (sql-1 "select   appshare_application_schema_id   from   public.appshare_web_sessions    where   session_id = ?" [data-session-id]))

         schema-name       (cond
                             app-schema-id
                             (:database_schema_name (sql-1 "select   database_schema_name   from   public.appshare_application_schemas  where  id = ?"  [app-schema-id]))

                             :else
                             "public")

         schema-name2      (if (= (count schema-name) 0) "public" schema-name)
         ]
    schema-name2))



