object Mysql extends Client[Request, Result] with MysqlRichClient
val client = Mysql.client .withCredentials("<username>", "<password>") .withDatabase("<db>") .newRichClient("inet!localhost:3306")
- Alphabetic
- By Inheritance
- Mysql
- MysqlRichClient
- Client
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Client(stack: Stack[ServiceFactory[Request, Result]] = Client.stack, params: Params = Client.params) extends StdStackClient[Request, Result, Client] with WithSessionPool[Client] with WithDefaultLoadBalancer[Client] with MysqlRichClient with Product with Serializable
Implements a mysql client in terms of a com.twitter.finagle.client.StackClient.
Implements a mysql client in terms of a com.twitter.finagle.client.StackClient. The client inherits a wealth of features from finagle including connection pooling and load balancing.
Additionally, this class provides methods via MysqlRichClient for constructing a client which exposes an API that has use case specific methods, for example mysql.Client.read, mysql.Client.modify, and mysql.Client.prepare. This is an easier experience for most users.
import com.twitter.finagle.Mysql import com.twitter.finagle.mysql.Client import com.twitter.util.Future val client: Client = Mysql.client .withCredentials("username", "password") .withDatabase("database") .newRichClient("host:port") val names: Future[Seq[String]] = client.select("SELECT name FROM employee") { row => row.stringOrNull("name") }
Example:
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def client: Client
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newClient(dest: Name, label: String): ServiceFactory[Request, Result]
Create a new client connected to
dest
.Create a new client connected to
dest
. See the user guide for details on destination names.Argument
label
is used to assign a label to this client. The label is used to display stats, etc. - final def newClient(dest: String, label: String): ServiceFactory[Request, Result]
Create a new client connected to
dest
.Create a new client connected to
dest
. See the user guide for details on destination names.Argument
label
is used to assign a label to this client. The label is used to display stats, etc.- Definition Classes
- Client
- final def newClient(dest: String): ServiceFactory[Request, Result]
Create a new client connected to
dest
.Create a new client connected to
dest
. See the user guide for details on destination names.- Definition Classes
- Client
- def newRichClient(dest: String): mysql.Client with Transactions
Creates a new
RichClient
connected to the logical destination described bydest
.Creates a new
RichClient
connected to the logical destination described bydest
.- dest
the location to connect to, e.g. "host:port". See the user guide for details on destination names.
- Definition Classes
- MysqlRichClient
- def newRichClient(dest: String, label: String): mysql.Client with Transactions
Creates a new
RichClient
connected to the logical destination described bydest
with the assignedlabel
.Creates a new
RichClient
connected to the logical destination described bydest
with the assignedlabel
. Thelabel
is used to scope client stats.- Definition Classes
- MysqlRichClient
- def newRichClient(dest: Name, label: String): mysql.Client with Transactions
Creates a new
RichClient
connected to the logical destination described bydest
with the assignedlabel
.Creates a new
RichClient
connected to the logical destination described bydest
with the assignedlabel
. Thelabel
is used to scope client stats.- Definition Classes
- MysqlRichClient
- def newService(dest: Name, label: String): Service[Request, Result]
Create a new service which dispatches requests to
dest
.Create a new service which dispatches requests to
dest
. See the user guide for details on destination names.Argument
label
is used to assign a label to this client. The label is used to display stats, etc. - final def newService(dest: String, label: String): Service[Request, Result]
Create a new service which dispatches requests to
dest
.Create a new service which dispatches requests to
dest
. See the user guide for details on destination names.- Definition Classes
- Client
- final def newService(dest: String): Service[Request, Result]
Create a new service which dispatches requests to
dest
.Create a new service which dispatches requests to
dest
. See the user guide for details on destination names.- Definition Classes
- Client
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def richClientStatsReceiver: StatsReceiver
- Definition Classes
- MysqlRichClient
- val supportUnsigned: Boolean
Whether the client supports unsigned integer fields
Whether the client supports unsigned integer fields
- Attributes
- protected
- Definition Classes
- Mysql → MysqlRichClient
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object Client extends Serializable