Skip to content

Commit

Permalink
Merge pull request #235 from xnuinside/release_1.0.3
Browse files Browse the repository at this point in the history
release version 1.0.3
  • Loading branch information
xnuinside committed Jan 20, 2024
2 parents f6ad6ec + 0f93a11 commit f605740
Show file tree
Hide file tree
Showing 6 changed files with 50,727 additions and 462 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
**v1.0.3**
### Improvements
1. Fixed bug with `CREATE OR REPLACE SCHEMA`.
2. Added support of create empty tables without columns CREATE TABLE tablename (); (valid syntax in SQL)

### Snowflake
1. Fixed bug with snowflake (stage_)fileformat option value equal a single string as `FIELD_OPTIONALLY_ENCLOSED_BY = '\"'`, `FIELD_DELIMITER = '|'`
1. Fixed bug with snowflake `stage_` fileformat option value equal a single string as `FIELD_OPTIONALLY_ENCLOSED_BY = '\"'`, `FIELD_DELIMITER = '|'`
2. improve snowflake fileformat key equals value into dict. type.

**v1.0.2**
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,15 @@ for help with debugging & testing support for BigQuery dialect DDLs:


## Changelog
**v1.0.3**
### Improvements
1. Fixed bug with `CREATE OR REPLACE SCHEMA`.
2. Added support of create empty tables without columns CREATE TABLE tablename (); (valid syntax in SQL)

### Snowflake
1. Fixed bug with snowflake `stage_` fileformat option value equal a single string as `FIELD_OPTIONALLY_ENCLOSED_BY = '\"'`, `FIELD_DELIMITER = '|'`
2. improve snowflake fileformat key equals value into dict. type.

**v1.0.2**
### Improvements
1. Fixed bug with places first table property value in 'authorization' key. Now it is used real property name.
Expand Down
16 changes: 16 additions & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,22 @@ for help with debugging & testing support for BigQuery dialect DDLs:
Changelog
---------

**v1.0.3**

Improvements
^^^^^^^^^^^^


#. Fixed bug with ``CREATE OR REPLACE SCHEMA``.
#. Added support of create empty tables without columns CREATE TABLE tablename (); (valid syntax in SQL)

Snowflake
^^^^^^^^^


#. Fixed bug with snowflake ``stage_`` fileformat option value equal a single string as ``FIELD_OPTIONALLY_ENCLOSED_BY = '\"'``\ , ``FIELD_DELIMITER = '|'``
#. improve snowflake fileformat key equals value into dict. type.

**v1.0.2**

Improvements
Expand Down
1 change: 1 addition & 0 deletions simple_ddl_parser/dialects/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ def p_expression_table(self, p: List) -> None: # noqa R701
"""expr : table_name defcolumn
| table_name LP defcolumn
| table_name
| table_name LP RP
| expr COMMA defcolumn
| expr COMMA
| expr COMMA constraint
Expand Down
51,130 changes: 50,669 additions & 461 deletions simple_ddl_parser/parsetab.py

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions tests/test_simple_ddl_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3421,3 +3421,33 @@ def test_non_int_type_paramteter():
"types": [],
}
assert results == expected


def test_create_empty_table_with_parentheses():
ddl = """
CREATE TABLE tablename ();
"""
result = DDLParser(ddl).run(group_by_type=True, output_mode="mysql")

expected = {
"ddl_properties": [],
"domains": [],
"schemas": [],
"sequences": [],
"tables": [
{
"alter": {},
"checks": [],
"columns": [],
"index": [],
"partitioned_by": [],
"primary_key": [],
"schema": None,
"table_name": "tablename",
"tablespace": None,
}
],
"types": [],
}
assert result == expected

0 comments on commit f605740

Please sign in to comment.