Created
February 28, 2013 07:10
-
-
Save dacc/5054859 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mkArrayRep(list: List[String]): String = | |
list.map(_.replace("\"", "\\\"").replace("\\", "\\\\")) | |
.mkString("{\"", "\", \"", "\"}") | |
def mkList(string: String): List[String] = { | |
val commaSeparated = string.substring(1, string.length - 1) | |
StringUtil.parseCsvLine(commaSeparated).toList | |
} | |
implicit def stringArrayMapper = MappedTypeMapper.base[List[String], String](mkArrayRep _, mkList _) | |
def someCol = column[List[String]]("some_col", O.DBType("text[]")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment