Skip to content

Instantly share code, notes, and snippets.


domdorn/MyPostgresProfile.scala Secret

Created Jan 19, 2021
What would you like to do?
Slick PostgreSQL List
trait MyPostgresProfile
extends ExPostgresProfile
with PgArraySupport
with PgDate2Support
with PgRangeSupport
with PgHStoreSupport {
def pgjson = "jsonb"
// Add back `capabilities.insertOrUpdate` to enable native `upsert` support; for postgres 9.5+
override protected def computeCapabilities: Set[Capability] =
super.computeCapabilities + slick.jdbc.JdbcCapabilities.insertOrUpdate
override val api = MyAPI
object MyAPI extends API with ArrayImplicits with DateTimeImplicits with RangeImplicits with HStoreImplicits {
val strSimpleJdbcArrayListType: SimpleArrayJdbcType[String] = new SimpleArrayJdbcType[String]("text")
implicit val strListTypeMapper: JdbcType[List[String]] =
// here we
implicit val useCaseListTypeMapper: JdbcType[List[UseCase]] = strSimpleJdbcArrayListType
.mapTo[UseCase](str => UseCase.of(str), uc => uc.label)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment