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
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]
no clue :/
Suyash Katiyar
@skatiyar
@jacoelho can you give some sample dataset and exact problem you are facing??
Elie Zedeck RANDRIAMIANDRIRAY
@eliezedeck
@dancannon is there a way to know more about the generated Errors. For example, in case of table already existing, is there a kind of error code (instead of error string) to compare to rather than checking the error message if it contains the text "already exists" or not?
Daniel Cannon
@dancannon
@eliezedeck Unfortunately not, for example this is what the driver gets back from RethinkDB
{"t":18,"e":4100000,"r":["Table `examples.games` already exists."],"b":[],"p":[{"duration(ms)":0.343791}]}
Elie Zedeck RANDRIAMIANDRIRAY
@eliezedeck
isn't the "e" item here the error identifier? I mean, for instance, all table already existing error message would always return "e" = 4100000, right?
if that is the case, that might be something that could be exported all the way to the error itself... it's more comfortable to trust the value of the "e" rather that the message that has higher chance of being updated in the future
Daniel Cannon
@dancannon
@eliezedeck Apologies you are completely correct!
The driver spec is missing that field so I completely ignored it haha
If you could create an issue on Github I will make sure it gets added in the next version
Elie Zedeck RANDRIAMIANDRIRAY
@eliezedeck
Sure... :)
Elie Zedeck RANDRIAMIANDRIRAY
@eliezedeck
@dancannon it's done
Daniel Cannon
@dancannon
Great thanks! Not sure when the next release will be but hopefully not too long
Elie Zedeck RANDRIAMIANDRIRAY
@eliezedeck
Cool! Thank YOU!