{"id":28387337,"url":"https://github.com/redisgraph/redisgraph-go","last_synced_at":"2025-08-13T17:10:46.659Z","repository":{"id":34071980,"uuid":"144484572","full_name":"RedisGraph/redisgraph-go","owner":"RedisGraph","description":"A Golang client for redisgraph","archived":false,"fork":false,"pushed_at":"2024-09-05T09:41:13.000Z","size":104,"stargazers_count":131,"open_issues_count":28,"forks_count":38,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-26T20:43:24.096Z","etag":null,"topics":["cypher","golang-client","graphdatabase","redis","redisgraph"],"latest_commit_sha":null,"homepage":"https://redisgraph.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedisGraph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-08-12T16:53:52.000Z","updated_at":"2025-03-14T10:39:12.000Z","dependencies_parsed_at":"2024-06-18T15:14:44.460Z","dependency_job_id":"eb5b405c-c07d-4575-837c-4aa177b866b4","html_url":"https://github.com/RedisGraph/redisgraph-go","commit_stats":null,"previous_names":["redislabs/redisgraph-go"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/RedisGraph/redisgraph-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisGraph%2Fredisgraph-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisGraph%2Fredisgraph-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisGraph%2Fredisgraph-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisGraph%2Fredisgraph-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedisGraph","download_url":"https://codeload.github.com/RedisGraph/redisgraph-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisGraph%2Fredisgraph-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270278395,"owners_count":24557179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypher","golang-client","graphdatabase","redis","redisgraph"],"created_at":"2025-05-30T17:11:19.608Z","updated_at":"2025-08-13T17:10:46.591Z","avatar_url":"https://github.com/RedisGraph.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![license](https://img.shields.io/github/license/RedisGraph/redisgraph-go.svg)](https://github.com/RedisGraph/redisgraph-go)\n[![CircleCI](https://circleci.com/gh/RedisGraph/redisgraph-go/tree/master.svg?style=svg)](https://circleci.com/gh/RedisGraph/redisgraph-go/tree/master)\n[![GitHub issues](https://img.shields.io/github/release/RedisGraph/redisgraph-go.svg)](https://github.com/RedisGraph/redisgraph-go/releases/latest)\n[![Codecov](https://codecov.io/gh/RedisGraph/redisgraph-go/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisGraph/redisgraph-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/RedisGraph/redisgraph-go)](https://goreportcard.com/report/github.com/RedisGraph/redisgraph-go)\n[![GoDoc](https://godoc.org/github.com/RedisGraph/redisgraph-go?status.svg)](https://godoc.org/github.com/RedisGraph/redisgraph-go)\n\n# redisgraph-go\n[![Forum](https://img.shields.io/badge/Forum-RedisGraph-blue)](https://forum.redislabs.com/c/modules/redisgraph)\n[![Discord](https://img.shields.io/discord/697882427875393627?style=flat-square)](https://discord.gg/gWBRT6P)\n\n`redisgraph-go` is a Golang client for the [RedisGraph](https://oss.redislabs.com/redisgraph/) module. It relies on [`redigo`](https://github.com/gomodule/redigo) for Redis connection management and provides support for RedisGraph's QUERY, EXPLAIN, and DELETE commands.\n\n## Installation\n\nSimply do:\n```sh\n$ go get github.com/redislabs/redisgraph-go\n```\n\n## Usage\n\nThe complete `redisgraph-go` API is documented on [GoDoc](https://godoc.org/github.com/RedisGraph/redisgraph-go).\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/gomodule/redigo/redis\"\n\trg \"github.com/redislabs/redisgraph-go\"\n)\n\nfunc main() {\n\tconn, _ := redis.Dial(\"tcp\", \"127.0.0.1:6379\")\n\tdefer conn.Close()\n\n\tgraph := rg.GraphNew(\"social\", conn)\n\n\tgraph.Delete()\n\n\tjohn := rg.Node{\n\t\tLabel: \"person\",\n\t\tProperties: map[string]interface{}{\n\t\t\t\"name\":   \"John Doe\",\n\t\t\t\"age\":    33,\n\t\t\t\"gender\": \"male\",\n\t\t\t\"status\": \"single\",\n\t\t},\n\t}\n\tgraph.AddNode(\u0026john)\n\n\tjapan := rg.Node{\n\t\tLabel: \"country\",\n\t\tProperties: map[string]interface{}{\n\t\t\t\"name\": \"Japan\",\n\t\t},\n\t}\n\tgraph.AddNode(\u0026japan)\n\n\tedge := rg.Edge{\n\t\tSource:      \u0026john,\n\t\tRelation:    \"visited\",\n\t\tDestination: \u0026japan,\n\t}\n\tgraph.AddEdge(\u0026edge)\n\n\tgraph.Commit()\n\n\tquery := `MATCH (p:person)-[v:visited]-\u003e(c:country)\n           RETURN p.name, p.age, c.name`\n\n\t// result is a QueryResult struct containing the query's generated records and statistics.\n\tresult, _ := graph.Query(query)\n\n\t// Pretty-print the full result set as a table.\n\tresult.PrettyPrint()\n\n\t// Iterate over each individual Record in the result.\n\tfmt.Println(\"Visited countries by person:\")\n\tfor result.Next() { // Next returns true until the iterator is depleted.\n\t\t// Get the current Record.\n\t\tr := result.Record()\n\n\t\t// Entries in the Record can be accessed by index or key.\n\t\tpName := r.GetByIndex(0)\n\t\tfmt.Printf(\"\\nName: %s\\n\", pName)\n\t\tpAge, _ := r.Get(\"p.age\")\n\t\tfmt.Printf(\"\\nAge: %d\\n\", pAge)\n\t}\n\n\t// Path matching example.\n\tquery = \"MATCH p = (:person)-[:visited]-\u003e(:country) RETURN p\"\n\tresult, err := graph.Query(query)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(\"Pathes of persons visiting countries:\")\n\tfor result.Next() {\n\t\tr := result.Record()\n\t\tp, ok := r.GetByIndex(0).(rg.Path)\n\t\tfmt.Printf(\"%s %v\\n\", p, ok)\n\t}\n}\n```\n\nRunning the above produces the output:\n\n```sh\n+----------+-------+--------+\n|  p.name  | p.age | c.name |\n+----------+-------+--------+\n| John Doe |    33 | Japan  |\n+----------+-------+--------+\n\nQuery internal execution time 1.623063\n\nName: John Doe\n\nAge: 33\n```\n\n## Running queries with timeouts\n\nQueries can be run with a millisecond-level timeout as described in [the module documentation](https://oss.redis.com/redisgraph/configuration/#timeout). To take advantage of this feature, the `QueryOptions` struct should be used:\n\n```go\noptions := NewQueryOptions().SetTimeout(10) // 10-millisecond timeout\nres, err := graph.QueryWithOptions(\"MATCH (src {name: 'John Doe'})-[*]-\u003e(dest) RETURN dest\", options)\n```\n\n`ParameterizedQueryWithOptions` and `ROQueryWithOptions` endpoints are also exposed by the client.\n\n## Running tests\n\nA simple test suite is provided, and can be run with:\n\n```sh\n$ go test\n```\n\nThe tests expect a Redis server with the RedisGraph module loaded to be available at localhost:6379\n\n## License\n\nredisgraph-go is distributed under the BSD3 license - see [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredisgraph%2Fredisgraph-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredisgraph%2Fredisgraph-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredisgraph%2Fredisgraph-go/lists"}