{"id":18592601,"url":"https://github.com/bytebase/plsql-parser","last_synced_at":"2025-11-02T03:30:30.197Z","repository":{"id":168908708,"uuid":"637625880","full_name":"bytebase/plsql-parser","owner":"bytebase","description":"The parser for Oracle 11g/12c PL/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/plsql).","archived":false,"fork":false,"pushed_at":"2024-12-17T10:02:36.000Z","size":25905,"stargazers_count":10,"open_issues_count":1,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-16T17:56:38.569Z","etag":null,"topics":["antlr","antlr-parser","antlr4","database","oracle","parser","plsql","sql","sql-parser"],"latest_commit_sha":null,"homepage":"https://www.bytebase.com","language":"ANTLR","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/bytebase.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,"publiccode":null,"codemeta":null}},"created_at":"2023-05-08T04:19:11.000Z","updated_at":"2024-12-17T10:02:41.000Z","dependencies_parsed_at":"2023-10-16T16:31:35.110Z","dependency_job_id":"697c7de8-3b1c-461d-86c0-fad04e94035b","html_url":"https://github.com/bytebase/plsql-parser","commit_stats":null,"previous_names":["bytebase/plsql-parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fplsql-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fplsql-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fplsql-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fplsql-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bytebase","download_url":"https://codeload.github.com/bytebase/plsql-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239370302,"owners_count":19627410,"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","antlr-parser","antlr4","database","oracle","parser","plsql","sql","sql-parser"],"created_at":"2024-11-07T01:09:11.967Z","updated_at":"2025-11-02T03:30:30.168Z","avatar_url":"https://github.com/bytebase.png","language":"ANTLR","readme":"The plsql-parser is a parser for Oracle 11g/12c PL/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/plsql).\n\n## Build\n\nBefore build, you need to install the ANTLR4.\n\nrequirements:\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. Update the `PlSqlLexer.g4` and `PlSqlParser.g4` in root directory.\n2. run `./build.sh` to generate the parser code.\n\n### From antlr4-grammars-plsql\n\n1. Clone the `PlSqlLexer.g4` and `PlSqlParser.g4` grammar files from https://github.com/antlr/grammars-v4/tree/master/sql/plsql into `parser` folder.\n2. Clone the https://github.com/antlr/grammars-v4/blob/master/sql/plsql/Go/transformGrammar.py into root directory.\n3. Run the `transformGrammar.py` to generate the `PlSqlLexer.g4` and `PlSqlParser.g4` in `parser` directory.\n4. Copy the `PlSqlLexer.g4` and `PlSqlParser.g4` to root directory.\n5. run `./build.sh` to generate the parser code.\n\n## Test the parser\n\nRun `TestPLSQLParser` in `parser_test.go` to test the parser.\n\n```bash\ngo test -v\n```\n\n## References\n\n- Oracle SQL Language Reference: https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Introduction-to-Oracle-SQL.html\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebase%2Fplsql-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytebase%2Fplsql-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebase%2Fplsql-parser/lists"}