Simple DDL Parser to parse SQL (HQL, TSQL, AWS Redshift, BigQuery, Snowflake and other dialects) ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc. & table properties, types, domains, etc.
Here is an example of how tests could be parametrized.
Pros:
Makes tests easy to read
Reduces the tests codebase
Possible cons:
A lot of new files with test data in fixtures/ directory. For the changed test the number of new files would be ~100.
Could increase time to find out what data is used for a particular tests case
A possible improvement to minimize cons:
We can create fixtures/ddl/and fixtures/parsed/ directories to separate SQL files from parsed JSON files. But still, it will be challenging to keep all fixture files for all tests. We can put each test module in its on directory with particular fixtures used in this test module. The code inside of test modules will be reduced but the number of files and hierarchy of the tests/ directory will increase.
Here is an example of how tests could be parametrized.
Pros:
Possible cons:
A possible improvement to minimize cons: We can create
fixtures/ddl/
andfixtures/parsed/
directories to separate SQL files from parsed JSON files. But still, it will be challenging to keep all fixture files for all tests. We can put each test module in its on directory with particular fixtures used in this test module. The code inside of test modules will be reduced but the number of files and hierarchy of thetests/
directory will increase.