You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading a uuid column it throws a match error. This is due the reason that JDBC returns a UUID instead of the expected byte array. Hacked around it with this extension method:
/*** * Provides extension methods to work around with issues caused by relate*/privateimplicitclassRichSqlResult(valr:SqlResult) {
/** * This method exists due the reason that `SqlResult.uuid` tries to read the UUID as a byte array while * the JDBC driver returns a UUID causing in a match error.*/defpostgresUUID(column: String):UUID=//This is copied from extractOption (which is protected) with some modifications
r.resultSet.getObject(column).asInstanceOf[Any] match {
case x if (x ==null|| r.resultSet.wasNull()) => sys.error(s"No such column found: $column")
casex: UUID=> x
case _ => sys.error("Not a postgres UUID")
}
}
The text was updated successfully, but these errors were encountered:
Interesting. We typically store a UUID as a byte array in the database using MySQL. This makes for an interesting problem for postgres. I'd really like to fix def uuid to support either (and any jdbc) database.
When reading a uuid column it throws a match error. This is due the reason that JDBC returns a UUID instead of the expected byte array. Hacked around it with this extension method:
The text was updated successfully, but these errors were encountered: