trait Connection extends Object with IEventEmitter
MySQL Connection
- Annotations
- @RawJSType() @native()
- Alphabetic
- By Inheritance
- Connection
- IEventEmitter
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
-
def
addListener(eventName: String, listener: Function): Connection.this.type
- Definition Classes
- IEventEmitter
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
beginTransaction(callback: Function): Unit
Starts a new transaction
Starts a new transaction
connection.beginTransaction(function(err) { ... })
Example: -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
commit(callback: Function): Unit
Commits a transaction
Commits a transaction
- callback
the error callback
commit(function(err) { ... })
Example: - val config: ConnectionOptions
-
def
connect(callback: Function): Unit
Creates a new connection
Creates a new connection
- callback
the results callback
-
def
destroy(): Unit
An alternative way to end the connection is to call the destroy() method.
An alternative way to end the connection is to call the destroy() method. This will cause an immediate termination of the underlying socket. Additionally destroy() guarantees that no more events or callbacks will be triggered for the connection.
-
val
domain: String
- Definition Classes
- IEventEmitter
-
def
emit(name: String, args: Any*): Any
- Definition Classes
- IEventEmitter
-
def
end(callback: Function): Unit
There are two ways to end a connection.
There are two ways to end a connection. Terminating a connection gracefully is done by calling the end() method
- callback
the error callback
connection.end(function(err) { ... })
Example: -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getMaxListeners(): Int
- Definition Classes
- IEventEmitter
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
listenerCount(eventName: String): Int
- Definition Classes
- IEventEmitter
-
def
listeners(eventName: String): Array[Function]
- Definition Classes
- IEventEmitter
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
on(eventName: String, listener: Function): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
once(eventName: String, listener: Function): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
ping(callback: Function): Unit
A ping packet can be sent over a connection using the connection.ping method.
A ping packet can be sent over a connection using the connection.ping method. This method will send a ping packet to the server and when the server responds, the callback will fire. If an error occurred, the callback will fire with an error argument.
connection.ping(function (err) { ... })
Example: -
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
query(options: QueryOptions, params: Array[Any], callback: Function): Unit
Asynchronously executes a query
Asynchronously executes a query
- options
the given query options
- params
the given query parameters
- callback
the results callback
connection.query('INSERT INTO log SET data=?', log, function(err, result) { ... })
Example: -
def
query(options: QueryOptions, callback: Function): Unit
Asynchronously executes a query
Asynchronously executes a query
- options
the given query options
- callback
the results callback
connection.query(options, function(err, results) { ... })
Example: -
def
query(query: String, callback: Function): Unit
Asynchronously executes a query
Asynchronously executes a query
- query
the given query string
- callback
the results callback
connection.query('INSERT INTO log SET data=?', log, function(err, result) { ... })
Example: -
def
query(query: String): Readable
Executes a query and streams the results
Executes a query and streams the results
- query
the given query string
- returns
a readable for streaming the results
-
def
release(): Unit
When you are done with a connection, just call connection.release() and the connection will return to the pool, ready to be used again by someone else.
-
def
removeAllListeners(): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
removeAllListeners(eventName: String): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
removeListener(eventName: String, listener: Function): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
rollback(callback: Function): Unit
Rolls back a transaction
Rolls back a transaction
- callback
the response callback (empty arguments)
-
def
setMaxListeners(n: Int): Connection.this.type
- Definition Classes
- IEventEmitter
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
val
usingDomains: Boolean
- Definition Classes
- IEventEmitter
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )