我试过了
users :: [Users] <- sqlQuery "SELECT * FROM users u … WHERE u.id IN ?" (userIds :: [Id User])
(Only userIds)和(In userIds),但没有成功。我在文档中找不到任何例子。
(Only userIds)
(In userIds)
gmxoilav1#
我猜它是在引擎盖下使用postgres-simple,https://hackage.haskell.org/package/postgresql-simple-0.6.5/docs/Database-PostgreSQL-Simple.html#g:6给出了答案:
users :: [Users] <- sqlQuery "SELECT * FROM users u … WHERE u.id IN ?" (Only (In userIds))
1条答案
按热度按时间gmxoilav1#
我猜它是在引擎盖下使用postgres-simple,https://hackage.haskell.org/package/postgresql-simple-0.6.5/docs/Database-PostgreSQL-Simple.html#g:6给出了答案: