有没有办法在代码中将一个巧妙的插补查询拆分到多行?我的查询往往会很长。
因此,我寻找类似以下内容的内容:
val query = sql"select * from DOCUMENTS " +
sql"where language = $lang order by publication_date desc"
query.as[ResearchDocument]
但这会导致
type mismatch;
found : scala.slick.jdbc.SQLInterpolationResult[String]
required: String
sql"where language = $lang order by publication_date desc"
^
好,看起来Scala三重引号字符串是可行的:
val query = sql"""select * from DOCUMENTS
where language = $lang order by publication_date desc"""
上一篇:SQLite的安全的Windows Phone 8.1安全、SQLite、Windows、Phone
下一篇:是否有一个等同于.NET 4.5:Storagefile.Openasync有一个、NET、Storagefile、Openasync