Skip to content

PostgresNIO 1.0.0 Beta 2.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@tanner0101 tanner0101 released this 12 Dec 04:07
128eeb9
  • Added PostgresConnection.addListener(channel:handler:) (#60)

This method lets you add handlers for LISTEN / NOTIFY messages.

// add notification listener to connection
conn.addListener(channel: "example") { context, notification in
    print(notification) // notification payload
    context.stop() // stop listening
}
// subscribe to notifications on this connection
_ = try conn.simpleQuery("LISTEN example").wait()
// send notification w/ empty payload
_ = try conn.simpleQuery("NOTIFY example").wait()
  • Adds PostgresData(array:elementType:) and PostgresData.array methods for untyped arrays (#67)

  • UInt8 can now decode from CHAR / BPCHAR (#41)

  • Added a ByteToMessageDecoderVerifier test (#68)