A small python based sql parser focusing on finding table dependencies within database views. Currently only working with Snowflake ANSI Sql
The current implementation handles the parser as an seperate app that can be used to parse sql files. This is not a stable version. Within the next month the goal is to translate that app in a pip package.
The parser works currently only if no AS or as is used in FROM or JOIN conditions, e.g.
SELECT
*
FROM a AS oop
-> This won't work
However this syntax will work:
SELECT
*
FROM a oop
- Download the repository
- Intialize the pipenv or generate a requirement.text and intialize it
- Create a json configuration file under parser/config/configuration.json (There is an example configuration available)
- Configure the SQLAlchemy engine
- Create the target database table (Sqllite or Snowflake engine) with SQLAlchemy. Therefore run:
python -m parsesql.main.database.init_db
Note: A sqlite file will be placed in the db directory of the package
- Configure the Runner class (multiprocessing, parsing vs. dataloading)
- Run the main module with:
python -m parsesql.app
For running test use:
python -m tests.run_all