Skip to content
Permalink
Browse files
when varchar length is unspecified, default to longvarchar in hsqldb
  • Loading branch information
stewSquared committed May 26, 2017
1 parent 8795239 commit 86114fa0fe385ae63c36153abd97aaddaa008246
Showing 1 changed file with 8 additions and 0 deletions.
@@ -1,3 +1,4 @@

package slick.jdbc

import java.sql.Types
@@ -65,6 +66,13 @@ trait HsqldbProfile extends JdbcProfile {

override val scalarFrom = Some("(VALUES (0))")

override def defaultSqlTypeName(tmd: JdbcType[_], sym: Option[FieldSymbol]): String = tmd.sqlType match {
case java.sql.Types.VARCHAR =>
val size = sym.flatMap(_.findColumnOption[RelationalProfile.ColumnOption.Length])
size.fold("LONGVARCHAR")(l => if(l.varying) s"VARCHAR(${l.length})" else s"CHAR(${l.length})")
case _ => super.defaultSqlTypeName(tmd, sym)
}

class QueryBuilder(tree: Node, state: CompilerState) extends super.QueryBuilder(tree, state) {
override protected val concatOperator = Some("||")
override protected val alwaysAliasSubqueries = false

0 comments on commit 86114fa

Please sign in to comment.