如何从 clojureql 查询 postgres Point 类型?我希望使用 PostGIS 功能,但 clojureql 似乎不包含此功能。
最佳答案
我不是 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 查询方式只是将查询转发到数据库“asis”,您也可以尝试在其中使用 PostGIS 运算符。
关于postgresql - 如何从 clojureql 查询 postgres Point 类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6642695/