schwartzmx / gremtune

Golang Gremlin Tinkerpop client with AWS Neptune compatibility
MIT License
26 stars 20 forks source link

【Question】What is the difference between tinkerpop/gremlin-go and gremtune #21

Open shcw opened 1 year ago

shcw commented 1 year ago

my first exposure to graph databases

pls allow me to ask a newbie question

https://github.com/apache/tinkerpop/blob/master/gremlin-go/README.md and https://github.com/schwartzmx/gremtune

what is the difference between them?

Does gremlin-go not support neptune ?

kamruljpi commented 9 months ago

Gremlin Go is support Neptune. you can check the below code:

package main

import (
    "crypto/tls"
    "fmt"

    gremlingo "github.com/apache/tinkerpop/gremlin-go/v3/driver"
)

func main() {
    driverRemoteConnection, err := gremlingo.NewDriverRemoteConnection("wss://YOUR_NEPTUNE_ENDPOINT_REPLACE_HERE:8182/gremlin",
        func(settings *gremlingo.DriverRemoteConnectionSettings) {
            settings.TraversalSource = "g"
            settings.TlsConfig = &tls.Config{InsecureSkipVerify: true}
        })
    if err != nil {
        fmt.Println(err)
        return
    }
    g := gremlingo.Traversal_().WithRemote(driverRemoteConnection)

    promise := g.AddV("users").Property("name", "kamruzzaman").Iterate()

    err = <-promise
    if err != nil {
        fmt.Println(err)
        return
    }

    result, err := g.V().HasLabel("users").Values("name").ToList()
    if err != nil {
        fmt.Println(err)
        return
    }
    for _, r := range result {
        fmt.Println("######################################################")
        fmt.Printf("name: %+v", r.GetString())
        fmt.Println("######################################################")
    }
}
kamruljpi commented 9 months ago

what is the difference between them? gremlin-go is like orm so you have to use their function to execute a gremlin query and gremtune you can execute the raw query. this is the basic difference as per as I know.