Skip to content

Commit

Permalink
Merge pull request #283 from dmaresma/fix/281
Browse files Browse the repository at this point in the history
Fix/281
  • Loading branch information
xnuinside authored Aug 20, 2024
2 parents 6494e42 + 338344c commit c03fa3e
Show file tree
Hide file tree
Showing 6 changed files with 705 additions and 63,346 deletions.
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

0 comments on commit c03fa3e

Please sign in to comment.