{"id":20448548,"url":"https://github.com/datacamp/antlr-plsql","last_synced_at":"2025-12-02T16:04:03.551Z","repository":{"id":57410673,"uuid":"84129143","full_name":"datacamp/antlr-plsql","owner":"datacamp","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-18T11:33:38.000Z","size":341,"stargazers_count":17,"open_issues_count":6,"forks_count":14,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-02-16T04:34:53.642Z","etag":null,"topics":["fs","le"],"latest_commit_sha":null,"homepage":null,"language":"ANTLR","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datacamp.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-03-06T22:50:25.000Z","updated_at":"2024-05-21T10:55:05.000Z","dependencies_parsed_at":"2022-08-28T01:14:07.073Z","dependency_job_id":null,"html_url":"https://github.com/datacamp/antlr-plsql","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Fantlr-plsql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Fantlr-plsql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Fantlr-plsql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Fantlr-plsql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datacamp","download_url":"https://codeload.github.com/datacamp/antlr-plsql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241997504,"owners_count":20055117,"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":["fs","le"],"created_at":"2024-11-15T10:35:40.658Z","updated_at":"2025-12-02T16:04:03.483Z","avatar_url":"https://github.com/datacamp.png","language":"ANTLR","funding_links":[],"categories":[],"sub_categories":[],"readme":"# antlr-plsql\n\n[![Build Status](https://travis-ci.org/datacamp/antlr-plsql.svg?branch=master)](https://travis-ci.org/datacamp/antlr-plsql)\n[![PyPI version](https://badge.fury.io/py/antlr-plsql.svg)](https://badge.fury.io/py/antlr-plsql)\n\n## Development\n\nANTLR requires Java, so we suggest you use Docker when building grammars. The `Makefile` contains directives to clean, build, test and deploy the ANTLR grammar. It does not run Docker itself, so run `make` inside Docker.\n\n### Build the grammar\n\n```bash\n# Build the docker container\ndocker build -t antlr_plsql .\n\n# Run the container to build the python grammar\n# Write parser files to local file system through volume mounting\ndocker run -it -v ${PWD}:/usr/src/app antlr_plsql make build\n```\n\n### Set up the Python module\n\nNow that the Python parsing files are available, you can install them with `pip`:\n\n```bash\npip install -r requirements.txt\npip install -e .\n```\n\nAnd parse SQL code in Python:\n\n```python\nfrom antlr_plsql import ast\nast.parse(\"SELECT a from b\")\n```\n\n### Using the AST viewer\n\nIf you're actively developing on the ANLTR grammar or the tree shaping, it's a good idea to set up the [AST viewer](https://github.com/datacamp/ast-viewer) locally so you can immediately see the impact of your changes in a visual way.\n\n- Clone the ast-viewer repo and build the Docker image according to the instructions.\n- Spin up a docker container that volume mounts the Python package, symlink-installs the package and runs the server on port 3000:\n\n```bash\ndocker run -it \\\n  -u root \\\n  -v ~/workspace/antlr-plsql:/app/app/antlr-plsql \\\n  -p 3000:3000 \\\n  ast-viewer \\\n  /bin/bash -c \"echo 'Install development requirements in development:' \\\n    \u0026\u0026 pip install --no-deps -e app/antlr-plsql \\\n    \u0026\u0026 python3 run.py\"\n```\n\nWhen simultaneously developing other packages, volume mount and install those too:\n\n```bash\ndocker run -it \\\n  -u root \\\n  -v ~/workspace/antlr-ast:/app/app/antlr-ast \\\n  -v ~/workspace/antlr-plsql:/app/app/antlr-plsql \\\n  -v ~/workspace/antlr-tsql:/app/app/antlr-tsql \\\n  -p 3000:3000 \\\n  ast-viewer \\\n  /bin/bash -c \"echo 'Install development requirements in development:' \\\n    \u0026\u0026 pip install --no-deps -e app/antlr-ast \\\n    \u0026\u0026 pip install --no-deps -e app/antlr-plsql \\\n    \u0026\u0026 pip install --no-deps -e app/antlr-tsql \\\n    \u0026\u0026 python3 run.py\"\n```\n\n- If you update the tree shaping logic in this repo, the app will auto-update.\n- If you change the grammar, you will have to first rebuild the grammar (with the `antlr_plsql` docker image) and restart the `ast-viewer` container.\n\n### Run tests\n\n```bash\n# Similar to building the grammar, but running tests\n# and not saving the generated files\ndocker build -t antlr_plsql .\ndocker run -t antlr_plsql make build test\n```\n\nOr run the test locally, first build the grammar then run:\n\n```python\npytest\n```\n\n## Travis deployment\n\n- Builds the Docker image.\n- Runs the Docker image to build the grammar and run the unit tests.\n- Deploys the resulting python files to PyPi when a new release is made, so they can be installed easily.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatacamp%2Fantlr-plsql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatacamp%2Fantlr-plsql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatacamp%2Fantlr-plsql/lists"}