 
   (try
     (exec-raw [(str "INSERT INTO " table " (surface, structure, serialized, language, model) VALUES (?,"
-                    "'" (json/write-str (strip-refs expression)) "'"
+                    "$$" (json/write-str (strip-refs expression)) "$$"
                     ","
-                    "'" (str (serialize expression)) "'"
+                    "$$" (str (serialize expression)) "$$"
                     ","
                     "?,?)")
                [surface

      (log/error (str "SQL error: " (.printStackTrace (.getNextException(.getSQLException e))))))))

(defn insert-lexeme [canonical lexeme language]
  (if (fail? lexeme)
    (let [message (str "Refusing to enter a :fail for canonical form: " canonical)] 
      (log/error message)

    (exec-raw [(str "INSERT INTO lexeme 
                                 (canonical, structure, serialized, language) 
                          VALUES (?,"
                    "$$" (json/write-str (strip-refs lexeme)) "$$"
                    ",?,?)")
               [canonical (str (serialize lexeme))
                language]])))
