Thursday, January 12, 2017

Emoji Support in Finagle MySQL

To enable emoji support for finagle-mysql

// See http://dev.mysql.com/doc/internals/en/character-set.html
val Utf8mb4_bin: Short = 46

val mysqlClient = Mysql.client.configured(
  DefaultPool.Param(
    low = 1, high = 50, bufferSize = 0,
    idleTime = Duration.Top,
    maxWaiters = Int.MaxValue)
).withDatabase(config.databaseName)
  .withCredentials(config.username, config.password)
  .withCharset(Utf8mb4_bin) // emoji support!  .newRichClient(config.hostAndPort)

No comments:

Post a Comment