{"id":22998397,"url":"https://github.com/tablelandnetwork/go-sqlparser","last_synced_at":"2025-04-02T13:24:37.681Z","repository":{"id":41145123,"uuid":"501423846","full_name":"tablelandnetwork/go-sqlparser","owner":"tablelandnetwork","description":"This is a Go library for parsing a Tableland SQL statement.","archived":false,"fork":false,"pushed_at":"2025-01-14T06:20:09.000Z","size":12980,"stargazers_count":9,"open_issues_count":15,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-25T17:03:25.581Z","etag":null,"topics":["sql","tableland"],"latest_commit_sha":null,"homepage":"https://tableland.xyz/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tablelandnetwork.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-08T22:02:22.000Z","updated_at":"2024-10-16T07:12:26.000Z","dependencies_parsed_at":"2023-10-24T09:30:21.374Z","dependency_job_id":"419edac5-e9c4-4018-b081-b23e8cb496b0","html_url":"https://github.com/tablelandnetwork/go-sqlparser","commit_stats":null,"previous_names":["tablelandnetwork/sqlparser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tablelandnetwork%2Fgo-sqlparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tablelandnetwork%2Fgo-sqlparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tablelandnetwork%2Fgo-sqlparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tablelandnetwork%2Fgo-sqlparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tablelandnetwork","download_url":"https://codeload.github.com/tablelandnetwork/go-sqlparser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246821018,"owners_count":20839342,"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","tableland"],"created_at":"2024-12-15T06:13:19.250Z","updated_at":"2025-04-02T13:24:37.632Z","avatar_url":"https://github.com/tablelandnetwork.png","language":"HTML","readme":"# Tableland SQL Parser\n\n[![Review](https://github.com/tablelandnetwork/sqlparser/actions/workflows/review.yml/badge.svg)](https://github.com/tablelandnetwork/sqlparser/actions/workflows/review.yml)\n[![Test](https://github.com/tablelandnetwork/sqlparser/actions/workflows/test.yml/badge.svg)](https://github.com/tablelandnetwork/sqlparser/actions/workflows/test.yml)\n[![Release](https://img.shields.io/github/release/tablelandnetwork/sqlparser.svg)](https://github.com/tablelandnetwork/sqlparser/releases/latest)\n[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg)](https://github.com/RichardLitt/standard-readme)\n\n\u003e Go library for parsing Tableland-compliant SQL\n\n# Table of Contents\n\n- [Tableland SQL Parser](#tableland-sql-parser)\n- [Table of Contents](#table-of-contents)\n- [Background](#background)\n- [Usage](#usage)\n- [Feedback](#feedback)\n- [Contributing](#contributing)\n- [License](#license)\n\n# Background\n\nThis is a Go library for parsing a Tableland SQL statement as defined by [Tableland SQL Specification](https://textile.notion.site/Tableland-SQL-Specification-9493b88eac8b4dd9ad5dc76323f7f087).\n\nIt uses `goyacc` to generate a parser based on a given [grammar](./grammar.y) and a given [lexer](lexer.go).\nWith the parser, you can generate an AST from a SQL statement.\n\nThis is inspired on the [xwb1989/sqlparser](https://github.com/xwb1989/sqlparser), with eyes on SQLite's [grammar](https://repo.or.cz/sqlite.git/blob/HEAD:/src/parse.y) and [spec](https://www.sqlite.org/lang.html).\n\n## Usage\n\n```go\nast, err := sqlparser.Parse(\"SELECT * FROM table WHERE c1 \u003e c2\")\nif err != nil {\n    panic(err)\n}\n\nast.PrettyPrint()\n```\n\nResulting AST:\n\n```bash\n(*sqlparser.AST)({\n Root: (*sqlparser.Select)({\n  SelectColumnList: (sqlparser.SelectColumnList) (len=1 cap=1) {\n   (*sqlparser.StarSelectColumn)({\n    TableRef: (*sqlparser.Table)(\u003cnil\u003e)\n   })\n  },\n  From: (*sqlparser.Table)({\n   Name: (string) (len=5) \"table\"\n  }),\n  Where: (*sqlparser.Where)({\n   Type: (string) (len=5) \"where\",\n   Expr: (*sqlparser.CmpExpr)({\n    Operator: (string) (len=1) \"\u003e\",\n    Left: (*sqlparser.Column)({\n     Name: (string) (len=2) \"c1\",\n     TableRef: (*sqlparser.Table)(\u003cnil\u003e)\n    }),\n    Right: (*sqlparser.Column)({\n     Name: (string) (len=2) \"c2\",\n     TableRef: (*sqlparser.Table)(\u003cnil\u003e)\n    }),\n    Escape: (sqlparser.Expr) \u003cnil\u003e\n   })\n  })\n })\n})\n ```\n\n# Contributing\n\nTo get started clone this repo.\n\n## Generating the parser\n\n```bash\ngo run golang.org/x/tools/cmd/goyacc@master -l -o yy_parser.go grammar.y\n```\n\n## Generating syntax diagrams\n\n```bash\nmake generate-diagrams \n```\n\nRequires Java 8 (or higher).\n\n# Feedback\n\nReach out with feedback and ideas:\n\n- [twitter.com/tableland\\_\\_](https://twitter.com/tableland__)\n- [Create a new issue](https://github.com/tablelandnetwork/sqlparser/issues)\n\n# License\n\nMIT AND Apache-2.0, © 2021-2022 Tableland Network Contributors","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftablelandnetwork%2Fgo-sqlparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftablelandnetwork%2Fgo-sqlparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftablelandnetwork%2Fgo-sqlparser/lists"}