如何从clojureql查询postgres Point类型?我希望使用PostGIS功能,但clojureql似乎不包括这个。
答案 0 :(得分:1)
我不是clojureql的专家,但是如果这个语法是正确的:
(with-connection db
(with-query-results rs ["select * from blogs"]
; rs will be a sequence of maps,
; one for each record in the result set.
(dorun (map #(println (:title %)) rs))))
(摘自here)
为什么不尝试将rs更改为:
select point[0] as x, point[1] as y from table
这会有用吗?我不确定它会不会,但如果这种Clojure查询方式只是将查询转发到DB“asis”,您可能会尝试使用其中的PostGIS运算符。