Skip to content

Commit

Permalink
Fix DBStore filter field name
Browse files Browse the repository at this point in the history
  • Loading branch information
alekslitvinenk committed Nov 13, 2023
1 parent 551d6d1 commit ff4ca12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/scala/io/dockovpn/metastore/db/Queries.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package io.dockovpn.metastore.db

import io.dockovpn.metastore.util.Strings.toCamelCase
import io.dockovpn.metastore.util.{FieldPredicate, Predicate}
import slick.jdbc.GetResult
import slick.jdbc.MySQLProfile.api._
Expand Down Expand Up @@ -51,7 +52,7 @@ object Queries {
// TODO: Implement Predicate -> SQL materializer
private def predicateToSql(predicate: Predicate): String = {
predicate match {
case FieldPredicate(field, _, value) => s"$field = '$value'"
case FieldPredicate(field, _, value) => s"${toCamelCase(field)} = '$value'"
case _ => "1=1" // not implemented
}
}
Expand Down

0 comments on commit ff4ca12

Please sign in to comment.