This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-03
Channels
- # adventofcode (2)
- # announcements (1)
- # asami (35)
- # babashka (67)
- # beginners (97)
- # cherry (3)
- # clj-yaml (3)
- # cljsrn (9)
- # clojure (44)
- # clojure-dev (34)
- # clojure-europe (13)
- # clojure-gamedev (1)
- # clojure-norway (10)
- # clojure-uk (2)
- # clojurescript (24)
- # clr (1)
- # conjure (18)
- # cursive (4)
- # datalevin (3)
- # emacs (6)
- # graalvm (9)
- # graphql (1)
- # introduce-yourself (1)
- # malli (7)
- # nrepl (3)
- # portal (1)
- # quil (2)
- # reagent (1)
- # reitit (21)
- # releases (1)
- # reveal (11)
- # ring (2)
- # shadow-cljs (17)
- # sql (24)
- # vim (4)
Hello, I'm actually experimenting with database access and struggled with a case sensitive column name. When running (pg/execute! db ["select columValue from table"])
an exception is thrown stating: ERROR: column "columvalue" does not exist
I already looked into the documentation of next.jdbc but haven't found a solution to keep the casing.
It might be best to to try this for debugging since the postgres pod might be a bit behind on the version of next.jdbc
But then I can't use Babashka for it?
I wouldn't know why a raw sql query might have capitalization problems, but it would be interesting to see if the JVM version also has this problem
CREATE TABLE table (
"id" serial,
"columValue" text NOT NULL
) ;
It is part of a different service.
Columns that are created using double quotes must be double quoted for all their life...
Quoting an identifier also makes it case-sensitive, whereas unquoted names are always folded to lower case. For example, the identifiers FOO, foo, and "foo" are considered the same by PostgreSQL, but "Foo" and "FOO" are different from these three and each other. (The folding of unquoted names to lower case in PostgreSQL is incompatible with the SQL standard, which says that unquoted names should be folded to upper case. Thus, foo should be equivalent to "FOO" not "foo" according to the standard. If you want to write portable applications you are advised to always quote a particular name or never quote it.)
Yes your right. Thanks for the explanation
@U11EL3P9U Thanks!
I’m getting this error in my editor (Neovim), but I think it’s a problem with my Babashka install (via homebrew)
LSP[clojure_lsp] Classpath lookup failed when running `/opt/homebrew/bin/bb print-deps --format classpath`. Some features may not work
properly.
When I run bb print-deps --format classpath
I get this:
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
Exception in thread "main" java.io.FileNotFoundException: /Users/john/.clojure/.cpcache/EC75370BCEABA1C0496F6D9CBE1EC430.cp (No such file or directory)
do you happen to have a .cpcache
in the dir youre in as well?
And I get a similar error regardless of the directory, although sometimes the specific missing filename is different.
@U0DTSCAUU Just for debugging, can you try:
bb --force print-deps --format classpath
this is interesting, now perhaps you can bisect the contents of bb print-deps
until you have something that works and doesn't work
Can you try:
bash <(curl -s ) --dir /tmp --dev-build
and then try again with /tmp/bb clojure -Spath
?Yep, that works. Interestingly, bb clojure -Spath
now works (my homebrew-installed bb, not the one in tmp), so something has changed, but bb print-deps --format classpath
is still broken.
don't know, without an exact copy of your hard disk... but I'll release a new bb this week or so, so maybe you can use the dev build until then
~/ws/deps.clj [master]
λ clojure -M -m borkdude.deps -Spath -Sdeps "$(bb print-deps)"
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
src:resources:/Users/john/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar:/Users/john/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar:/Users/john/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar
Although this works, using same classpath as above:
λ java -cp /Users/john/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar:/Users/john/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar:/Users/john/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar clojure.main
Clojure 1.11.1
user=>
I’ve wiped 1.11.1
from my .m2
and re-run clojure -M -m borkdude.deps -Spath -Sdeps "$(bb print-deps)"
. On the first run I see it downloading the new Clojure JARs but the error still occurs, even on subsequent runs.
ok, so if you check out deps.clj locally you could try inserting some printlns, etc to check what's going on
I seem to recall seeing the error after I upgraded to Clojure 1.11.1.1208 from some previous version of 1.11.1.
I’m not sure re “tap” vs “homebrew package”. Does this answer the question?
λ brew info clojure
==> clojure: stable 1.11.1.1208 (bottled)
Another data point: bb print-deps
had stopped working. It was throwing ClassNotFoundException for clojure.main, which is why clojure -M -m borkdude.deps -Spath -Sdeps "$(bb print-deps)"
. I changed bb
to /tmp/bb
, which worked, but it also fixed bb print-deps
. The above clojure -M…
command now works.
@U04V15CAJ it appears the upgrade to 1.0.169 has somehow fixed my problem. Thanks for your help!