{"id":13671001,"url":"https://github.com/vescale/zgraph","last_synced_at":"2025-04-27T13:33:27.446Z","repository":{"id":64100745,"uuid":"566646441","full_name":"vescale/zgraph","owner":"vescale","description":"An embeddable graph database for large-scale vertices and edges","archived":false,"fork":false,"pushed_at":"2023-04-16T03:24:47.000Z","size":1086,"stargazers_count":73,"open_issues_count":5,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-11T08:43:39.753Z","etag":null,"topics":["database","embeddable","graph","graph-database","pgql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vescale.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}},"created_at":"2022-11-16T05:31:22.000Z","updated_at":"2024-09-15T18:57:48.000Z","dependencies_parsed_at":"2024-04-01T00:42:46.979Z","dependency_job_id":null,"html_url":"https://github.com/vescale/zgraph","commit_stats":{"total_commits":117,"total_committers":6,"mean_commits":19.5,"dds":"0.45299145299145294","last_synced_commit":"4802db74cc5493ddbafe755127ac10200d8d0991"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vescale%2Fzgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vescale%2Fzgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vescale%2Fzgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vescale%2Fzgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vescale","download_url":"https://codeload.github.com/vescale/zgraph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251145833,"owners_count":21543105,"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","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":["database","embeddable","graph","graph-database","pgql"],"created_at":"2024-08-02T09:00:55.480Z","updated_at":"2025-04-27T13:33:22.435Z","avatar_url":"https://github.com/vescale.png","language":"Go","readme":"# What is zGraph\n[![Go Reference](https://pkg.go.dev/badge/github.com/vescale/zgraph.svg)](https://pkg.go.dev/github.com/vescale/zgraph)\n[![GitHub Actions](https://github.com/vescale/zgraph/workflows/Check/badge.svg)](https://github.com/vescale/zgraph/actions?query=workflow%3ACheck)\n\nzGraph is a [PGQL](https://pgql-lang.org/)-compatible embeddable graph database for large-scale vertices. \nYou can find the specification [here](https://pgql-lang.org/spec/1.5/).\n\n## Installation\n\n```bash\ngo get -u github.com/vescale/zgraph\n```\n\n## Quick Start\n\n### Playground\n\n```bash\n\u003e make build\n\u003e ./bin/zgraph play\n```\n\n### Build Application\nzGraph implements driver for [database/sql](https://golang.org/pkg/database/sql/). To use zGraph, you can simply import zGraph package and use `zgraph` as the driver name in `sql.Open`.\n\nHere is an example of how to use create a graph and query it. The graph is an example in [PGQL specification](https://pgql-lang.org/spec/1.5/#edge-patterns).\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"fmt\"\n\t\"log\"\n\n\t_ \"github.com/vescale/zgraph\"\n)\n\nfunc main() {\n\tdb, err := sql.Open(\"zgraph\", \"test.db\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer db.Close()\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tconn, err := db.Conn(ctx)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Create a graph.\n\tmustExec(ctx, conn, \"CREATE GRAPH student_network\")\n\n\t// Change the current graph.\n\tmustExec(ctx, conn, \"USE student_network\")\n\n\t// Create labels.\n\tmustExec(ctx, conn, \"CREATE LABEL Person\")\n\tmustExec(ctx, conn, \"CREATE LABEL University\")\n\tmustExec(ctx, conn, \"CREATE LABEL knows\")\n\tmustExec(ctx, conn, \"CREATE LABEL studentOf\")\n\n\t// Create vertices.\n\tmustExec(ctx, conn, `INSERT VERTEX x LABELS (Person) PROPERTIES (x.name = 'Kathrine', x.dob = DATE '1994-01-15')`)\n\tmustExec(ctx, conn, `INSERT VERTEX x LABELS (Person) PROPERTIES (x.name = 'Riya', x.dob = DATE '1995-03-20')`)\n\tmustExec(ctx, conn, `INSERT VERTEX x LABELS (Person) PROPERTIES (x.name = 'Lee', x.dob = DATE '1996-01-20')`)\n\tmustExec(ctx, conn, `INSERT VERTEX x LABELS (University) PROPERTIES (x.name = 'UC Berkeley')`)\n\n\t// Create edges.\n\tmustExec(ctx, conn, `INSERT EDGE e BETWEEN x AND y LABELS ( knows ) FROM MATCH (x), MATCH (y) WHERE x.name = 'Kathrine' AND y.name = 'Lee'`)\n\tmustExec(ctx, conn, `INSERT EDGE e BETWEEN x AND y LABELS ( knows ) FROM MATCH (x), MATCH (y) WHERE x.name = 'Kathrine' AND y.name = 'Riya'`)\n\tmustExec(ctx, conn, `INSERT EDGE e BETWEEN x AND y LABELS ( knows ) FROM MATCH (x), MATCH (y) WHERE x.name = 'Lee' AND y.name = 'Kathrine'`)\n\tmustExec(ctx, conn, `INSERT EDGE e BETWEEN x AND y LABELS ( studentOf ) FROM MATCH (x), MATCH (y) WHERE x.name = 'Kathrine' AND y.name = 'UC Berkeley'`)\n\tmustExec(ctx, conn, `INSERT EDGE e BETWEEN x AND y LABELS ( studentOf ) FROM MATCH (x), MATCH (y) WHERE x.name = 'Lee' AND y.name = 'UC Berkeley'`)\n\tmustExec(ctx, conn, `INSERT EDGE e BETWEEN x AND y LABELS ( studentOf ) FROM MATCH (x), MATCH (y) WHERE x.name = 'Riya' AND y.name = 'UC Berkeley'`)\n\n\t// Query the graph.\n\trows, err := conn.QueryContext(ctx, \"SELECT a.name AS a, b.name AS b FROM MATCH (a:Person) -[e:knows]-\u003e (b:Person)\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar a, b string\n\tfor rows.Next() {\n\t\tif err := rows.Scan(\u0026a, \u0026b); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tfmt.Printf(\"'%s' knows '%s'\\n\", a, b)\n\t}\n}\n\nfunc mustExec(ctx context.Context, conn *sql.Conn, query string) {\n\t_, err := conn.ExecContext(ctx, query)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\n## Contributing\n\nWe welcome contributions from everyone. zGraph is in its early stages, if you have any ideas or suggestions, please feel free to open an issue or pull request.\n\n## License\n\nzGraph is licensed under the Apache 2.0 license. See [LICENSE](LICENSE) for the full license text.\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvescale%2Fzgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvescale%2Fzgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvescale%2Fzgraph/lists"}