Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 26 22:12
    CodyDWJones edited #499
  • Sep 26 22:12
    CodyDWJones opened #499
  • Sep 26 20:07
    CodyDWJones closed #498
  • Sep 24 17:24
    CodyDWJones commented #497
  • Sep 24 17:06
    CodyDWJones closed #497
  • Sep 23 21:42
    CodyDWJones commented #498
  • Sep 23 14:35
    CMogilko commented #498
  • Sep 23 13:49

    CMogilko on master

    Upgrade to Python 3.8 (#496) *… (compare)

  • Sep 23 13:49
    CMogilko closed #496
  • Sep 23 13:47

    CMogilko on master

    Make it easier for new contribu… (compare)

  • Sep 23 13:47
    CMogilko closed #495
  • Sep 23 13:45

    CMogilko on master

    Fix failing Travis CI jobs (#49… (compare)

  • Sep 23 13:45
    CMogilko closed #494
  • Sep 20 16:40
    CodyDWJones edited #498
  • Sep 16 16:47
    CodyDWJones synchronize #498
  • Sep 16 16:26
    CodyDWJones synchronize #498
  • Sep 16 05:23
    CodyDWJones synchronize #498
  • Sep 16 03:47
    CodyDWJones synchronize #498
  • Sep 15 23:55
    CodyDWJones synchronize #498
  • Sep 15 18:10
    CodyDWJones synchronize #498
Daniel Cannon
@dancannon
I dont think it is in any other drivers
In gorethink this tends to be handled internally
Especially since GoRethink has a host and connection pool so the driver user shouldnt really need to care about reconnections
Suyash Katiyar
@skatiyar
ok cool was wondering if its driver specific or more of a rethink thing
Daniel Cannon
@dancannon
If you think it would be useful + know how to implement it then go for it. I am just not sure if we need it
Suyash Katiyar
@skatiyar
for now lets punt it, if needed will do it.
what drivers do you take for reference usually??
Daniel Cannon
@dancannon
Python + rethinkdbdash
Daniel Cannon
@dancannon
@SKatiyar have you started work on .Server()?
Daniel Cannon
@dancannon
I had a go at it as well and changed the cluster connection code to use a hostpool. Let me know what you think @SKatiyar https://github.com/dancannon/gorethink/compare/develop...feature/server-info
If you have already worked on the Server function I would like to see how you solved it
Suyash Katiyar
@skatiyar
@dancannon i did a very simple thing, SKatiyar/gorethink#3
did not test it yet
so not sure if it works
Suyash Katiyar
@skatiyar
@dancannon testing the local code becomes a pain when proto spec changes, any easy way to rewrite the imports for local testing??
Daniel Cannon
@dancannon
@SKatiyar not sure what you mean? Are you using and old version of RethinkDB?
Also the reason that I put the query code into the Connection and bubbled up the result is that eventually I want to use this function in the cluster connection code and I didnt want to duplicate the query.
Its not ideal having to put the Server call in so many different files but I think it is still manageable
Suyash Katiyar
@skatiyar
the fork of repo still uses “github.com/dancannon/gorethink/ql2
so when testing local changes, have to rewrite the import in multiple files
just wondering any good way, apart from linux utility like sed etc.
Daniel Cannon
@dancannon
Ah I see
Suyash Katiyar
@skatiyar
what reason for changing from get random node to get next node??
Daniel Cannon
@dancannon
So when working on somebody elses code in Go I usually go getthe upstream version and then add my fork as a new remote.
The reason for GetNextNode is that I switched to using the go-hostpool library which means that the host selection is no longer random but instead based on the errors and response times for each host
Suyash Katiyar
@skatiyar
thanks for the tip, would help a lot
William McGann
@tehbilly
That's what I do as well, get then upstream changes. To move your package and not lose your changes: https://godoc.org/golang.org/x/tools/cmd/gomvpkg
What's happening with the current driver when getting a change feed from 2.2? Can test/help later this evening, but curious
Daniel Cannon
@dancannon
@tehbilly It should be coming pretty soon, a couple of small things need finishing.
William McGann
@tehbilly
Has more to do with my curiosity than any kind of waiting, ha. Interested in how/if the data over the wire changed.
Daniel Cannon
@dancannon
@tehbilly there is no change to how data is sent over the wire
GoRethink has used the JSON protocol for quite some time now
Regarding the atomic change feeds the driver simply sends an argument to RethinkDB and then treats the response the same way it would treat any changefeed.
Hope that answers any questions you had.
@SKatiyar Is your PR ready to be merged?
Suyash Katiyar
@skatiyar
@dancannon yeah, commits squashed but didnt add test for IncludeInitial + IncludeStates
if required will add today and push
also any idea how to test new changefeed_queue_size in changesOpts??
Daniel Cannon
@dancannon
@SKatiyar I will merge your changes and add the changefeed_queue_size option. Thanks for all the work you have done!
Daniel Cannon
@dancannon
If anybody would like to play with Go + RethinkDB 2.2 early check out this branch https://github.com/dancannon/gorethink/compare/release/v1.2.0. I hope to release GoRethink v1.2.0 some time tomorrow
Suyash Katiyar
@skatiyar
:+1:
Daniel Cannon
@dancannon
@/all GoRethink 2.2 has just been released! Check out the changes here https://github.com/dancannon/gorethink/releases/tag/v1.2.0
Fredrik Forsmo
@frozzare
awesome!
José Coelho
@jacoelho

hello,

I'm trying to querying the following data:

{
"id":  "123456789" ,
"stuff": {
  "stuff_one":  "123456" ,
  "stuff_two": {
    "name":  "stuff" ,
    "description":  "something"
  }
}

Using data explorer: r.db('test').table('description').get('123456789').getField('stuff'):

{
  "stuff_one":  "123456" ,
  "stuff_two": {
    "name":  "stuff" ,
    "description":  "something"
  }

using gorethink: r.Table("description").Get('123456789').Field('stuff')

{%!V(string=123456) {%!V(string=) %!V(string=)}}

what am I missing here?
Suyash Katiyar
@skatiyar
import "fmt"
import r "github.com/dancannon/gorethink"

func main() {
    conn, connErr := r.Connect(r.ConnectOpts{Address: "localhost:21015"})
    if connErr != nil {
        fmt.Println(connErr)
        return
    }

    query, queryErr := r.Table("test").Get("123456789").Field("stuff").Run(conn)
    if queryErr != nil {
        fmt.Println(queryErr)
        return
    }

    var ole interface{}
    if scanErr := query.One(&ole); scanErr != nil {
        fmt.Println(scanErr)
        return
    }

    fmt.Println(ole)
}
Works fine for me, try checking for errors.
@jacoelho it prints map[stuff_one:123456 stuff_two:map[description:something name:stuff]]
José Coelho
@jacoelho
hmm, thank you! I will recheck it
Daniel Cannon
@dancannon
@jacoelho it looks like you were not actually calling Run(session), @SKatiyar answer should work but if you are still having issues could you please post the code you are trying to use.
José Coelho
@jacoelho
after some debug:
r.Table("description").EqJoin("id", r.Table("products"), r.EqJoinOpts{Index: "description_id"}).Zip().Filter(map[string]interface{}{"id": d.Id}).Field("settings").Run(session)

map[description_id:123456789 id:987654321 name:something stuff:map[stuff_one:123456 stuff_two:map[name: description:]]]
but this query:
r.Table("description").Get("123456789").Field("settings").Run(session)

map[stuff_one:123456 stuff_two:map[name:stuff description:something]