2017-07-28 2 views
0

私はポストグルにpg-slick拡張を使用しています。私はwhere節で計算をしようとするが、私はそれを働かせない。スリックタイムスタンプ計算

value - is not a member of java.sql.Timestamp 

フィルター句:

.filter(r => Timestamp.from(Instant.now()) - r.lastActivity < Duration.ofMinutes(30)) 

lastActivityがある:それは常に言う

def lastActivity = column[Timestamp]("last_activity") 

と私のPostgresのドライバは、次のとおりです。

trait MyPostgresDriver extends ExPostgresProfile 
    with PgPostGISSupport 
    with PgDate2Support 
    with PgEnumSupport { 

    override val api: API = new API {} 

    /// 
    trait API extends super.API 
    with PostGISImplicits 
    with DateTimeImplicits 
    with PostGISAssistants { 
    } 
} 
object MyPostgresDriver extends MyPostgresDriver 

答えて

0

の追加:

val plainAPI = new API 
    with Date2DateTimePlainImplicits {} 

問題を解決するようです。 with DateTimeImplicitswith PgDateSupportを追加することも忘れないでください。