Fork me on GitHub
#honeysql
<
2022-08-24
>
oly08:08:46

On the of chance anyone has some ideas, I was curious if honey would work with klipse for interactive snippets, I can import the library but running a simple example fails with this.

ERROR: TypeError: clojure.core.into is not a function
Evaluating this simple example
(-> (sqlh/select :*)
  (sqlh/from :company)
  (sqlh/where [:= :id 1]))
Anyone tried this before or know if it may be possible ?

krydos22:08:32

I haven’t played with klipse but do you have any example of how you were able to import honeysql so we can try it on our end? It looks like honeysql works well with clojurescript and there is even this nice web app - https://john.shaffe.rs/honeysql/ where you can play with it. it looks like klipse is able to load libraries just based on what’s defined in require but I I’m not sure if it works with honeysql.

oly08:08:04

[:pre.cm-s-rdark.bg-near-black.silver.pa2.hljs.roboto.overflow-auto.klipse
                                               {:data-external-libs ""} content]
So basically you add the data-external-libs as an attribute to include it then you just require honey as usual so a block like this in side the pre tag above.
(ns core.demo
  (:require
   [honey.sql :as sql]
   [honey.sql.helpers :as sqlh]))

(-> (sqlh/select :*)
    (sqlh/from :company)
    (sqlh/where [:= :id 1]))
Docs mention data external libs below. https://github.com/viebel/klipse/blob/master/README.md#clojure-only-1

seancorfield04:08:13

I see you asked in the #klipse channel in early July and didn't get an answer to that? HoneySQL definitely works in regular ClojureScript environments so I suspect this is something to do with Klipse perhaps getting confused by the :refer-clojure :exclude stuff? You'll have to push harder there for an answer I think. Perhaps you can create a tiny repro using a fresh GH repro and a ns that excludes a core function and then redefines it and see what Klipse does?

Oliver Marks13:08:42

yeah I thought that could be the, case one of those things I looked into and got around to taking another stab, but like to ask around in case any oe has tried previously before spending to much time on the issue.

oly08:08:36

I noticed in the code honey seems to have it's own into function so I wonder if its related to that