{"id":18592600,"url":"https://github.com/bytebase/tsql-parser","last_synced_at":"2025-07-10T01:42:46.635Z","repository":{"id":181173149,"uuid":"666055080","full_name":"bytebase/tsql-parser","owner":"bytebase","description":"The parser for SQL Server. It is based on the ANTLR4","archived":false,"fork":false,"pushed_at":"2025-03-11T08:56:25.000Z","size":13318,"stargazers_count":3,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T01:53:25.642Z","etag":null,"topics":["antlr","antlr4","antlr4-parser","database","parser","sql","sql-parser","sql-server","sqlserver"],"latest_commit_sha":null,"homepage":"https://www.bytebase.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bytebase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-07-13T15:48:22.000Z","updated_at":"2025-03-11T08:56:30.000Z","dependencies_parsed_at":"2024-04-17T10:43:34.015Z","dependency_job_id":"4fb37f23-47c6-46b8-be59-83877d5db79e","html_url":"https://github.com/bytebase/tsql-parser","commit_stats":null,"previous_names":["bytebase/tsql-parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Ftsql-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Ftsql-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Ftsql-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Ftsql-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bytebase","download_url":"https://codeload.github.com/bytebase/tsql-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252691,"owners_count":21072699,"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":["antlr","antlr4","antlr4-parser","database","parser","sql","sql-parser","sql-server","sqlserver"],"created_at":"2024-11-07T01:09:11.820Z","updated_at":"2025-04-10T16:30:28.232Z","avatar_url":"https://github.com/bytebase.png","language":"C++","readme":"The tsql-parser is a parser for T-SQL. It is based on the [ANTLR4](https://github.com/antlr/antlr4) and use the grammar from [antlr4-grammars-plsql](https://github.com/antlr/grammars-v4/tree/master/sql/tsql).\n\n## Build\n\nBefore build, you need to install the ANTLR4.\n\nrequirements:\n\n- https://github.com/antlr/antlr4/blob/master/doc/getting-started.md\n- https://github.com/antlr/antlr4/blob/master/doc/go-target.md\n\n```bash\n./build.sh\n```\n\n## Update grammar\n\n### Manually change the grammar file in this project\n\n1. run `./build.sh` to generate the parser code.\n\n### From antlr4-grammars-tsql\n\n1. Clone the `TSqlLexer.g4` and `TSqlParser.g4` grammar files from https://github.com/antlr/grammars-v4/tree/master/sql/snowflake.\n2. Clone the examples[https://github.com/antlr/grammars-v4/tree/master/sql/tsql/examples], and use it for test.\n3. run `./build.sh` to generate the parser code.\n\n## Test the parser\n\nRun `TestTSQLParser` in `parser_test.go` to test the parser.\n\n```bash\ngo test -v\n```\n\n## References\n\n- ANTLR4 Getting Started https://github.com/antlr/antlr4/blob/master/doc/getting-started.md\n- ANTLR4 Go Garget https://github.com/antlr/antlr4/blob/master/doc/go-target.md\n\n## Port\n\nPort folder contains the ported code in another language.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebase%2Ftsql-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytebase%2Ftsql-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebase%2Ftsql-parser/lists"}