Assumes the underlying table's key and value columns are both strings.
Supported MySQL column types are: BLOB, TEXT, VARCHAR.
The finagle-mysql client is required to set the user, database and create
the underlying table schema prior to this class being used.
Storehaus-mysql also works with pre-populated MySQL tables, based on the assumption
that the key column picked is unique.
Any table columns other than the picked key and value columns are ignored during reads and
writes.
Example usage:
import com.twitter.finagle.exp.mysql.Client
import com.twitter.storehaus.mysql.MySqlStore
val client = Client("localhost:3306", "storehaususer", "test1234", "storehaus_test")
val schema = """CREATE TABLE `storehaus-mysql-test` (
`key` varchar(40) DEFAULT NULL,
`value` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"""// or, use an existing pre-populated table.
client.query(schema).get
val store = MySqlStore(client, "storehaus-mysql-test", "key", "value")
Simple storehaus wrapper over finagle-mysql.
Assumes the underlying table's key and value columns are both strings. Supported MySQL column types are: BLOB, TEXT, VARCHAR.
The finagle-mysql client is required to set the user, database and create the underlying table schema prior to this class being used.
Storehaus-mysql also works with pre-populated MySQL tables, based on the assumption that the key column picked is unique. Any table columns other than the picked key and value columns are ignored during reads and writes.
Example usage: