{"id":13693820,"url":"https://github.com/blastrain/vitess-sqlparser","last_synced_at":"2025-04-12T17:46:19.244Z","repository":{"id":47480849,"uuid":"99784229","full_name":"blastrain/vitess-sqlparser","owner":"blastrain","description":"simply SQL Parser for Go ( powered by vitess and TiDB )","archived":false,"fork":false,"pushed_at":"2022-11-14T17:12:15.000Z","size":7176,"stargazers_count":463,"open_issues_count":19,"forks_count":80,"subscribers_count":21,"default_branch":"develop","last_synced_at":"2025-04-04T04:15:41.925Z","etag":null,"topics":["ddl-parser","go","golang","golang-library","mysql","sql-parser"],"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/blastrain.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}},"created_at":"2017-08-09T08:32:20.000Z","updated_at":"2025-04-02T01:44:08.000Z","dependencies_parsed_at":"2023-01-23T02:01:23.835Z","dependency_job_id":null,"html_url":"https://github.com/blastrain/vitess-sqlparser","commit_stats":null,"previous_names":["knocknote/vitess-sqlparser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blastrain%2Fvitess-sqlparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blastrain%2Fvitess-sqlparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blastrain%2Fvitess-sqlparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blastrain%2Fvitess-sqlparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blastrain","download_url":"https://codeload.github.com/blastrain/vitess-sqlparser/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248609649,"owners_count":21132916,"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":["ddl-parser","go","golang","golang-library","mysql","sql-parser"],"created_at":"2024-08-02T17:01:18.507Z","updated_at":"2025-04-12T17:46:19.223Z","avatar_url":"https://github.com/blastrain.png","language":"Go","readme":"# vitess-sqlparser\n\nSimply SQL and DDL parser for Go (powered by vitess and TiDB )\nthis library inspired by https://github.com/xwb1989/sqlparser\n\n(original source : https://github.com/youtube/vitess/tree/master/go/vt/sqlparser)\n\n# Why\n\n[xwb1989/sqlparser](https://github.com/xwb1989/sqlparser) is famous sql parser in Go.  \nBut it cannot parse some query (like offset or bulk insert...) because it customizes vitess's sql parser.  \n\nAlso, some libraries use from vitess sql parser directly. But vitess's sql parser only partial supports DDL parsing.  \n\nWe want to perfectly support parsing for SQL and DDL.  \nTherefore we use vitess sql parser directly and also use TiDB parser for DDL parsing. \n\n# Compare SQL parser libraries in Go\n\n| library | supports offset (or other complexity) query | supports DDL |\n|:---:|:---:|:---:|\n|xwb1989/sqlparser |✗ | △|\n|zhenjl/sqlparser | ○|△ |\n|knocknote/vitess-sqlparser|○|○|\n\n# Installation\n\n## [NOTE] Required Go version more than 1.9\n\n```\ngo get -u github.com/knocknote/vitess-sqlparser\n```\n\n# Examples\n\n```go\npackage main\n\nimport (\n \t\"fmt\"\n\t\"github.com/blastrain/vitess-sqlparser/sqlparser\"\n)\n\nfunc main() {\n\tstmt, err := sqlparser.Parse(\"select * from user_items where user_id=1 order by created_at limit 3 offset 10\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Printf(\"stmt = %+v\\n\", stmt)\n}\n\n```\n","funding_links":[],"categories":["开源类库","Open source library","\u003ca name=\"Go\"\u003e\u003c/a\u003eGo"],"sub_categories":["数据库","Database"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblastrain%2Fvitess-sqlparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblastrain%2Fvitess-sqlparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblastrain%2Fvitess-sqlparser/lists"}