io.scalajs.npm.mysql.package.scala Maven / Gradle / Ivy
The newest version!
package io.scalajs.npm
import io.scalajs.nodejs.stream.Readable
import scala.scalajs.js
/**
* MySQL package object
* @author [email protected]
*/
package object mysql {
type RowDataPacket = js.Any
/**
* Stream Extensions
* @author [email protected]
*/
implicit class StreamExtensions(val readable: Readable) extends AnyVal {
/**
* Emitted once to detail the field packets for the rows to follow
*/
@inline
def onFields(callback: js.Array[FieldPacket] => Any): readable.type = readable.on("fields", callback)
/**
* Emitted for each row of the result set
*/
@inline
def onResult[T <: RowDataPacket](callback: RowDataPacket => Any): readable.type = readable.on("result", callback)
}
}