在Doobie中编写以下查询时:
.slider-paging-number li .count { color: red }
我有数据列表,例如列表(1,2,3,4)变化大小。 如何使用Doobie将值列表插入到SQL VALUES CLAUSE中?
答案 0 :(得分:0)
嗨,您可以在doobie官方社区页面上引用以下参考:
Consider a below table DDL:
CREATE TABLE country (
code character(3) NOT NULL,
name text NOT NULL,
population integer NOT NULL,
gnp numeric(10,2)
-- more columns, but we won't use them here
)
使用doobie语法的SQL,其中代码是大小可变的列表:
sql"""
select code, name, population, gnp
from country
where code in (${codes : codes.type})
""".query[Country]