{"id":19282805,"url":"https://github.com/kanaries/gw-dsl-parser","last_synced_at":"2025-04-22T01:32:20.986Z","repository":{"id":186094729,"uuid":"674521011","full_name":"Kanaries/gw-dsl-parser","owner":"Kanaries","description":"Generate SQL from Graphic Walker visualization DSL","archived":false,"fork":false,"pushed_at":"2024-02-23T06:09:51.000Z","size":1844,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-03-15T21:05:31.917Z","etag":null,"topics":["sql","visualization"],"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/Kanaries.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":"2023-08-04T06:34:13.000Z","updated_at":"2023-10-28T03:12:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"5bd05626-a9a6-4945-8167-b05d2d4b0bca","html_url":"https://github.com/Kanaries/gw-dsl-parser","commit_stats":null,"previous_names":["kanaries/gw-dsl-parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kanaries%2Fgw-dsl-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kanaries%2Fgw-dsl-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kanaries%2Fgw-dsl-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kanaries%2Fgw-dsl-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kanaries","download_url":"https://codeload.github.com/Kanaries/gw-dsl-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223886740,"owners_count":17219802,"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":["sql","visualization"],"created_at":"2024-11-09T21:28:28.555Z","updated_at":"2024-11-09T21:28:29.078Z","avatar_url":"https://github.com/Kanaries.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Graphic Walker DSL Parser \n\n\u003e The project is currently in testing \u0026 validation. Welcome the community to raise issues and contribute code.\n\n\n## Introduction\n\n![./LICENSE](https://img.shields.io/github/license/kanaries/gw-dsl-parser?style=flat-square)\n[![](https://img.shields.io/badge/twitter-kanaries_data-03A9F4?style=flat-square\u0026logo=twitter)](https://twitter.com/kanaries_data)\n[![](https://img.shields.io/discord/987366424634884096?color=%237289da\u0026label=Discord\u0026logo=discord\u0026logoColor=white\u0026style=flat-square)](https://discord.gg/WWHraZ8SeV)\n[![](https://img.shields.io/badge/Slack-green?style=flat-square\u0026logo=slack\u0026logoColor=white)](https://kanaries-community.slack.com/join/shared_invite/zt-20hho6t45-_OSDdTQamnrSnOW6C2PTgg)\n\nThis project converts Graphic Walker DSL into SQL, which is needed for connecting Graphic Walker with databases/OLAP/data services. By integrating with Graphic Walker's server-side mode, it pushes down computations to the query engine for improved performance.\n\n* Leverage the query engine for faster processing instead of pulling all data to the application layer\n* Reduce data transfer between database and application server\n* Allow users to analyze data using their own databases\n\n\n## Quick Start\n\nRegarding the definition of the Graphic Walker DSL and how to integrate it, \nplease refer to the Graphic Walker documentation. Here we will focus on describing how to use the SDK.\n\n\nBefore integrating, we need to understand two parameters: `Dataset` and `GraphicWalkerDSL`. \n\n- `GraphicWalkerDSLDSL`: `GraphicWalkerDSL` is the serialized DSL obtained by passing GraphicWalker directly to the backend.\n- `Dataset` is your abstraction of the data source.  \n\nFor example: \n- If you want to query a Mysql table called ***\"test_table\"***, you need to define the `Dataset` as follows:\n```go\npackage main\n\nimport (\n\t\"github.com/kanaries/gw-dsl-parser/parser\"\n)\n\nfunc main() {\n\t// refer to this doc on how to get the API Key: ：https://github.com/Kanaries/pygwalker/wiki/How-to-get-api-key-of-kanaries%3F\n\tclient := parser.NewClient(\"ak\")\n\t\n\t// define the fields of the dataset\n\tfields := make(map[string]parser.Field)\n\tfields[\"col_1\"] = parser.Field{\n\t\tKey:  \"col_1\",\n\t\tFid:  \"col_1\",\n\t\tType: parser.STRING,\n\t}\n\t// construct the dataset, name it \"test_table\"\n\tdataset := parser.NewDataset(\"test_table\", fields, \"mysql\")\n\n\t// query from graphic walker request\n\tquery := `\n\t{\n\t  \"workflow\": [\n\t\t{\n\t\t  \"type\": \"view\",\n\t\t  \"query\": [\n\t\t\t{\n\t\t\t  \"op\": \"raw\",\n\t\t\t  \"fields\": [\n\t\t\t\t\"col_1\"\n\t\t\t  ]\n\t\t\t}\n\t\t  ]\n\t\t}\n\t  ]\n\t}\n\t`\n\tsql, err := client.Parse(dataset, query)\n\tif err != nil {\n\t\tprintln(err)\n\t}\n\tprintln(sql)\n\n}\n\n```\n\n## Supported databases\n\n- [x] Postgresql\n- [x] DuckDB\n- [x] Snowflake\n- [x] MySQL\n- [x] BigQuery\n- [x] ClickHouse\n\n    \n\n## How to run in other languages\n\n- python: https://github.com/Kanaries/gw-dsl-parser-py\n- js: https://www.npmjs.com/package/@kanaries/gw-dsl-parser\n## Features\n\n- More database support ( Snowflake, ClickHouse, etc.)\n- SQL syntax compatibility test\n\n\n## LICENSE\nPlease refer to [LICENSE](https://github.com/Kanaries/gw-dsl-parser/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanaries%2Fgw-dsl-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanaries%2Fgw-dsl-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanaries%2Fgw-dsl-parser/lists"}