v2.4.1 - Overhaul
Overhaul
This release brings in the two week effort to rewrite of driver, bringing in some breaking changes as well as new features and bug fixes.
Breaking Changes ⚠️
- #7
ReqlAst.run
doesn't returnT
anymore.- Now it always returns
Result<T>
, no matter if it's an atom or sequence.
- Now it always returns
- #7
Cursor<T>
was removed.- Replaced with
Result<T>
, which implements the same functionality.
- Replaced with
- #7
java.util.Optional
usage was replaced by@Nullable
annotations.- Code that previously looked like
conn.db().get()
orconn.db().orElse(null)
, will now look likeconn.db()
. Use null checks (Objects.requireNotNull
,if (value != null) { }
) instead of the Optional API.
- Code that previously looked like
- #7
MapObject
now has generics.- Raw usage of MapObject will require generics,
r.hashMap()
will work as usual. GroupedResult
also now has generics.
- Raw usage of MapObject will require generics,
- #7
Connection.Builder
doesn't implementCloneable
anymore.- The
clone()
method was renamed tocopyOf()
, if you need that functionality.
- The
- #7 Internal classes
Query
,Response
,Util
,Crypto
were modified;SocketWrapper
,Handshake
,ScramAtributtes
were deleted. It should be noted that you weren't supposed to use them. - #7 Annotation
@id
was moved fromcom.rethinkdb.converter
tocom.rethinkdb.annotations
.
New Features 🚀
- #7 New
Result<T>
, the replacement class forCursor<T>
ReqlAsr.run()
always returnsResult<T>
, which covers all result types and implementsIterator<T>
,Iterable<T>
andCloseable
.toList()
,collect(Collector)
,stream()
,parallelStream()
,first()
,single()
,forEach(Consumer)
methods.- Those methods automatically close the Result, so you don't need to worry about closing it.
- Auto-closing: If
result.hasNext()
return false, the result was automatically closd. - Fetch modes for partial sequences, which can be set on the connection or overwritten manually.
- If enabled, unwraps atom responses which are lists (
Result<List<T>>
, with a single result, will be unwrapped toResult<T>
, with multiple results) - Exposed Response's Profile to the Result
- Pending, leaking Results can be closed from the Connection
- #7 The connection and the response pump are now wrapped in an interface and custom factories can be set in the builder, with the default factories implemented at
DefaultConnectionFactory
- #7 Added
r.pathspec(...)
(Implements #16) - #7 Implemented
CoerceType
to use oncoerceTo
instead of strings. - #7 Added support for db-urls (Implements rethinkdb/rethinkdb#4101)
- #7 New
Connection.noreplyWaitAsync()
, which returnsCompletableFuture<Void>
, so you can asynchronous wait your noreply. - #7 New
Connection.server()
andConnection.serverAsync()
(Implements #14)
Bug Fixes 🔧
- #7 Fixes
Util.toReqlAst()
wrongly resetting the remaining depth. - #7 Now
Util.toReqlAst()
properly serializes primitive arrays and other Collections as well. - #22 [GRADLE] Fixed signing being required on Gradle
assemble
task.
Improvements 👍
- #7
ReqlAst
improvements- Support for Jackson's
TypeReference<T>
onReqlAst.run()
, so you can pass anew TypeReference<Map<String,List<PersonalStuff>>>(){}
instead of a poorMap.class
- New
ReqlAst.runAsync()
, which returnsCompletableFuture<Result<T>>
, for all the async goodness. ReqlAst.toString()
now pretty-prints the AST
- Support for Jackson's
- #7 Connection rewrite
- Use of ConnectionSocket and ResponsePump
- The handshake is entirely handled by the HandshakeProtocol class instead of the connection socket.
- #7 Documentation for most public methods
- #7 A lot of small performance improvements.
Other Changes 🗒️
- #7 [GRADLE] Added option to generate main files out of local json files.
- #7 [GRADLE] Added Bintray support.
- #19 [GRADLE] Replaced email address.
- #20 [GRADLE] Travis CI initial configuration.
- #24 [GRADLE] Added support for
confidential.properties
file.