我正在尝试对NULL
特定搜索和返回索引重用查询(基本上实现了这里讨论的想法http://dev.solita.fi/2015/12/29/SQL-in-applications.html)。但是,我ERROR: could not determine data type of parameter $1
随时尝试将函数体与[]
参数一起使用。
这是clojure
(defn get-ips
"Get a list of IPs and their User Ids"
([] (ip-addresses {:uids nil}))
([uids] (ip-addresses {:uids uids})))
这是sql
-- name: ip-addresses
SELECT ipo.ip_address_id::varchar as address, ipo.user_id
FROM ip_ownerships AS ipo
WHERE :uids IS NULL OR ipo.user_id IN (:uids)