Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/281 #283

Merged
merged 3 commits into from
Aug 20, 2024
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
**v1.6.1**
### Fixes
1. #289 CREATE SCHEMA IF NOT EXISTS plus comment fail
2. schema or db.schema location in snowflake

**v1.6.0**
### IMPORTANT:
In this versions there is some output changes & fixes that can break your code.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "simple-ddl-parser"
version = "1.6.0"
version = "1.6.1"
description = "Simple DDL Parser to parse SQL & dialects like HQL, TSQL (MSSQL), Oracle, AWS Redshift, Snowflake, MySQL, PostgreSQL, etc ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc.; sequences, alters, custom types & other entities from ddl."
authors = ["Iuliia Volkova <xnuinside@gmail.com>"]
license = "MIT"
Expand Down
9 changes: 4 additions & 5 deletions simple_ddl_parser/dialects/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@ def p_cluster_by(self, p: List) -> None:

def p_multi_id_or_string(self, p: List) -> None:
"""multi_id_or_string : id_or_string
| multi_id_or_string id_or_string
| f_call
| multi_id_or_string f_call
"""
| EQ id_or_string
| id DOT multi_id_or_string
| multi_id_or_string EQ id_or_string"""
p_list = list(p)
if isinstance(p[1], list):
p[0] = p[1]
p[0].append(p_list[-1])
else:
totrim = " ".join(p_list[1:])
p[0] = totrim.replace(" = ", "=").replace("= ", "")
p[0] = totrim.replace(" = ", "=").replace("= ", "").replace(" . ", ".")

# todo: need to review & maybe simplify / remove
def p_table_property_equals(self, p: List) -> None:
Expand Down
5 changes: 1 addition & 4 deletions simple_ddl_parser/dialects/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,7 @@ def p_create_schema(self, p: List) -> None:
| c_schema id DOT id
| c_schema IF NOT EXISTS id
| c_schema IF NOT EXISTS id DOT id
| create_schema id id id
| create_schema id id STRING
| create_schema options
"""
| create_schema options"""
p_list = list(p)
p[0] = {}
auth_index = None
Expand Down
Loading
Loading