开发者

Working with wide SQL tables using ScalaQuery (or something else type-safe)

开发者 https://www.devze.com 2023-03-20 08:18 出处:网络
Many databases have tables with many columns, but ScalaQuery uses tuples to represent table schemas, and Scala doesn\'t support s开发者_如何学运维uch wide tuples. Is there any way to work with such ta

Many databases have tables with many columns, but ScalaQuery uses tuples to represent table schemas, and Scala doesn't support s开发者_如何学运维uch wide tuples. Is there any way to work with such tables using ScalaQuery (short of dropping down to executing raw SQL)? If not, is there any other type-safe querying language that supports this?


Squeryl is a Scala MySQL ORM that appears to map table rows to classes using name equivalence, so it should have no problem working with many-column tables. I personally haven't used this but it looks fairly easy to use.


Mapped projections to the rescue! http://szeiger.de/blog/2009/09/27/a-scala-query-update/

0

精彩评论

暂无评论...
验证码 换一张
取 消