Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,6 @@ dmypy.json
# End of https://www.toptal.com/developers/gitignore/api/python,vscode

.project

# OSX stuff
.DS_Store
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[settings]
known_third_party = black,click,jinja2,pytest,setuptools,sql_to_code
known_third_party = antlr4,black,click,jinja2,pytest,setuptools,sql_to_code
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
default_language_version:
python: python3.7

exclude: |
(?x)^(
sql_to_code/parsers/generated/PLpgSQLLexer.py|
sql_to_code/parsers/generated/PLpgSQLParser.py
)$

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
click
Jinja2
black
antlr4-python3-runtime
3 changes: 2 additions & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#
# pip-compile --output-file=requirements/base.txt requirements/base.in
#

antlr4-python3-runtime==4.9.1
# via -r requirements/base.in
appdirs==1.4.4
# via black
black==20.8b1
Expand Down
4 changes: 3 additions & 1 deletion sql_to_code/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ def generate(template_name: str, context: Context) -> str:

def generate_models(input_sql: str, generator: str, output_file: str) -> None:
file_content: str = get_file_content(filename=input_sql)
raw_sql_commands: List[str] = parse_commands(content=file_content)
# raw_sql_commands: List[str] = parse_commands(content=file_content)
context: Context = create_context(raw_sql_commands)

context: Context = parse_commands(content=file_content)

remmaper, output_template = GENERATOR_CONFIGS[generator]

remmaper.remap(context)
Expand Down
Loading