Permalink
Browse files

add text type to postgres column builder

  • Loading branch information...
1 parent 408f2e5 commit 04e67f6e33884922f44a7a9711c8602d6c7b69c1 @stewSquared stewSquared committed Mar 23, 2016
Showing with 2 additions and 0 deletions.
  1. +2 −0 slick/src/main/scala/slick/jdbc/PostgresProfile.scala
@@ -64,11 +64,13 @@ trait PostgresProfile extends JdbcProfile {
}
override def createColumnBuilder(tableBuilder: TableBuilder, meta: MColumn): ColumnBuilder = new ColumnBuilder(tableBuilder, meta) {
val VarCharPattern = "^'(.*)'::character varying$".r
+ val TextPattern = "^'(.*)'::text".r
val IntPattern = "^\\((-?[0-9]*)\\)$".r
override def default = meta.columnDef.map((_,tpe)).collect{
case ("true","Boolean") => Some(Some(true))
case ("false","Boolean") => Some(Some(false))
case (VarCharPattern(str),"String") => Some(Some(str))
+ case (TextPattern(str),"String") => Some(Some(str))
case (IntPattern(v),"Int") => Some(Some(v.toInt))
case (IntPattern(v),"Long") => Some(Some(v.toLong))
case ("NULL::character varying","String") => Some(None)

0 comments on commit 04e67f6

Please sign in to comment.