rethinkdb-java
rethinkdb-java copied to clipboard
Make POJOs for RethinkDB-specific objects.
Currently, the query r.table("test").insert(r.hashMap("foo", "bar").run(conn)
returns a Map.
But this is the Java driver and we'd have a better interface if we had a POJO, provided by the driver, to unserialize to. This would make the query just barely slightly bigger:
r.table("test").insert(r.hashMap("foo", "bar").run(conn, TableOperation.class)
But this would give automatic completion for all the documented values.
List of known objects:
- [x] CoerceType (coerceTo)
- [ ] Profile
- [ ] Backtrace
- [ ] DbChanges (dbCreate and dbDrop)
- [ ] TableChanges (tableCreate and tableDrop)
- [ ] IndexChanges (indexCreate, indexRename and indexDrop)
- [ ] IndexStatus (indexStatus and indexWait
- [ ] WriteHook (getWriteHook and setWriteHook)
- [ ] TableOperation (insert, update, replace, delete and sync)
- [x] GroupedResult (group)
- [ ] MatchResult (match)
- [x] ~~TimeObject (now, time, epochTime, iso8601, inTimezone, date)~~ Converted to OffsetDateTime
- [ ] TypeOf (typeOf)
- [ ] Info (info)
- [ ] Http (http)
- [ ] Geometry (circle)
- [ ] Polygon (fill, geojson, polygon, polygonSub)
- [ ] Line (line)
- [ ] Point (point)
- [ ] GrantResult (grant)
- [ ] ConfigResult (config)
- [ ] RebalanceResult (rebalance)
- [ ] ReconfigureResult (reconfigure)
- [ ] TableStatus (status)
- [ ] WaitResult (wait)
(Note: these aren't official nor final names)
Would love to see this! Especially handling of "errors"