Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
ANTLR 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.
# Build the docker container
docker build -t antlr_tsql .
# Run the container to build the python grammar
# Write parser files to local file system through volume mounting
docker run -it -v ${PWD}:/usr/src/app antlr_tsql make build
Now that the Python parsing files are available, you can install them with pip
:
pip install -r requirements.txt
pip install -e .
And parse SQL code in Python:
from antlr_tsql import ast
ast.parse("SELECT a from b")
If you're actively developing on the ANLTR grammar or the tree shaping, it's a good idea to set up the AST viewer locally so you can immediately see the impact of your changes in a visual way.
docker run -it \
-u root \
-v ~/workspace/antlr-tsql:/app/app/antlr-tsql \
-p 3000:3000 \
ast-viewer \
/bin/bash -c "echo 'Install development requirements in development:' \
&& pip install --no-deps -e app/antlr-tsql \
&& python3 run.py"
When simultaneously developing other packages, volume mount and install those too:
docker run -it \
-u root \
-v ~/workspace/antlr-ast:/app/app/antlr-ast \
-v ~/workspace/antlr-plsql:/app/app/antlr-plsql \
-v ~/workspace/antlr-tsql:/app/app/antlr-tsql \
-p 3000:3000 \
ast-viewer \
/bin/bash -c "echo 'Install development requirements in development:' \
&& pip install --no-deps -e app/antlr-ast \
&& pip install --no-deps -e app/antlr-plsql \
&& pip install --no-deps -e app/antlr-tsql \
&& python3 run.py"
antlr_tsql
docker image) and restart the ast-viewer
container.# Similar to building the grammar, but running tests
# and not saving the generated files
docker build -t antlr_tsql .
docker run -t antlr_tsql make build test
Or run the test locally, first build the grammar then run:
pytest
FAQs
A transact sql parser, written in Antlr4
We found that antlr-tsql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.