v1.15 - Extended query protocol
https://luarocks.org/modules/leafo/pgmoon
https://opm.openresty.org/package/leafo/pgmoon/
Additions
- Add support for Postgres extended query protocol (using text transport) See https://github.com/leafo/pgmoon#extended-and-simple-query-protocols
- Add support for
pgmoon_serialize
metamethod on objects to allow objects to describe how they can be serialized See https://github.com/leafo/pgmoon#custom-type-serializer - Implement
pgmoon_serialize
for the includedPostgresArray
type - Add the
set_type_deserializer
method for easier configuration of deserialization (the undocumentedset_type_oid
method is deprecated) See https://github.com/leafo/pgmoon#custom-type-deserializer
Changes
- The
query
method can now take additional arguments to cause the query to be sent using the extended query protocol with parameters from the arguments - Array deserialization is now aware of the
NULL
value and will returnpostgres.NULL
instead of the string"NULL"
self.sock
is no longer set tonil
when callingdisconnect
orkeepalive
(you can reconnect again without allocating a new socket- Calling
disconnect
will now send a terminate message to the server before closing the socket, following the disconnection protocol - previously, on some errors, the socket would be disconnected. This is no longer the case, if message processing fails then the function returns the error result but the socket is left as is so you can continue to attempt operations on it
escape_literal()
can now takepgmoon.NULL
as a value and will returnNULL
convert_nulls
is now a config option specified in the constructor- Minor performance optimizations to batch together network operations where possible
Misc
- Substantial updates to documentation: detailing new features, usage tips and examples, and other organizational updates
- Add test suite runner for openresty using
resty
command