Skip to content

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xnuinside committed Mar 29, 2023
1 parent b1b79ce commit ba0acc3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 265 deletions.
3 changes: 0 additions & 3 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ Added support for ORGANIZE BY statement

2. Added support for PostgreSQL INHERITS statement. Issue: https://github.com/xnuinside/simple-ddl-parser/issues/191

3. Added support for TRUNCATE statement. Issue: https://github.com/xnuinside/simple-ddl-parser/issues/190


**v0.29.1**
### Important updates:
1. Python 3.6 is deprecated in tests and by default, try to move to Python3.7, but better to 3.8, because 3.7 will be deprecated in 2023.
Expand Down
122 changes: 13 additions & 109 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,19 @@ https://github.com/swiatek25


## Changelog
**v0.30.0**
### Fixes:

1. IDENTITY now parsed normally as a separate column property. Issue: https://github.com/xnuinside/simple-ddl-parser/issues/184

### New Features:

1. IN TABLESPACE IBM DB2 statement now is parsed into 'tablespace' key. Issue: https://github.com/xnuinside/simple-ddl-parser/issues/194.
INDEX IN also parsed to 'index_in' key.
Added support for ORGANIZE BY statement

2. Added support for PostgreSQL INHERITS statement. Issue: https://github.com/xnuinside/simple-ddl-parser/issues/191

**v0.29.1**
### Important updates:
1. Python 3.6 is deprecated in tests and by default, try to move to Python3.7, but better to 3.8, because 3.7 will be deprecated in 2023.
Expand Down Expand Up @@ -790,112 +803,3 @@ Fixies:
#### MSSQL
3. Added support for CONSTRAINT [CLUSTERED]... PRIMARY KEY for Table definition
4. Added support for WITH statement in CONSTRAINT (Table definition)


**v0.19.9**
1. Fixed issue with the weird log - https://github.com/xnuinside/simple-ddl-parser/issues/78.


**v0.19.8**
Features:
1. Method `DDLParser(...).run(...)` now get argument json=True if you want to get result as json,
but not as Python Object

Fixes:
1. Fixed issue when variables are 'glue' during Struct parse like previously STRUCT<a ARRAY<STRING>,b BOOL> was
extracted like 'STRUCT <aARRAY <STRING>,bBOOL>', now this issue was fixed and it parsed as is STRUCT < a
ARRAY < STRING > ,b BOOL >. Now '>' and '<' always will be with space near them.

2. CHECK CONSTRAINT with functions. Fix for https://github.com/xnuinside/simple-ddl-parser/issues/76.


**v0.19.7**
Fixes:
1. Add support for more special symbols to strings - https://github.com/xnuinside/simple-ddl-parser/issues/68

Features:
1. Added support for HQL statements:
STORED AS INPUTFORMAT, OUTPUTFORMAT - https://github.com/xnuinside/simple-ddl-parser/issues/69
SKEWED BY

**v0.19.6**
Fixes:

1. Fixed issue with PARTITIONED BY multiple columns in HQL - https://github.com/xnuinside/simple-ddl-parser/issues/66
2. Question symbol '?' now handled valid in strings - https://github.com/xnuinside/simple-ddl-parser/issues/64
3. Fixed issue with escaping symbols & added tests -https://github.com/xnuinside/simple-ddl-parser/issues/63

Features:

1. Added support for HQL statement TBLPROPERTIES - https://github.com/xnuinside/simple-ddl-parser/issues/65

**v0.19.5**
Fixes:

1. Fixed issues with COMMENT statement in column definitions. Add bunch of tests, now they expect working ok.


**v0.19.4**
1. Added support for PARTITION BY (previously was only PARTITIONED BY from HQL)

**v0.19.2**
1. Added support for ` quotes in column & tables names

**v0.19.1**
Fixes:
1. Issue with '\t' reported in https://github.com/xnuinside/simple-ddl-parser/issues/53

Features:
1. Added base for future BigQuery support: added output_mode="bigquery". Pay attention that there is no schemas in BigQuery, so schemas are Datasets.


**v0.19.0**
**Features**

1. Added support for base Snowflake SQL Dialect.
Added new --output-mode='snowflake' (add "clone" key)

Added support for CREATE .. CLONE with same behaviour as CREATE .. LIKE
Added support for CREATE .. CLONE for schemas and database - displayed in output as {"clone": {"from": ... }}
CREATE TABLE .. CLUSTER BY ..
CONSTRAINT .. [NOT] ENFORCED (value stored in 'primary_key_enforced')

2. in CREATE DATABASE properties that goes after name like key=value now parsed valid. Check examples in tests
3. Added support for varchar COLLATE column property

**v0.18.0**
**Features**
1. Added base support fot AWS Redshift SQL dialect.
Added support for ENCODE property in column.
Added new --output-mode='redshift' that add to column 'encrypt' property by default.
Also add table properties: distkeys, sortkey, diststyle, encode (table level encode), temp.

Supported Redshift statements: SORTKEY, DISTSTYLE, DISTKEY, ENCODE

CREATE TEMP / TEMPORARY TABLE

syntax like with LIKE statement:

create temp table tempevent(like event);

**v0.17.0**
1. All dependencies were updated for the latest version.
2. Added base support for CREATE [BIGFILE | SMALLFILE] [TEMPORARY] TABLESPACE
3. Added support for create table properties like `TABLESPACE user_data ENABLE STORAGE IN ROW CHUNK 8K RETENTION CACHE`
4. Added support for CREATE DATABASE statement

**v0.16.3**
1. Fixed issue then using columns names equals some tokens like, for example, `key` caused the error.
But still words 'foreign' and 'constraint' as column names cause the empty result. I hope they rarely used.
Will be fixed in next releases.

**v0.16.2**
1. Fixed issue with enum in lowercase


**v0.16.0**
1. Fixed the issue when NULL column after DEFAULT used as default value.
2. Added support for generated columns, statatements: AS , GENERATED ALWAYS, STORED in Column Defenitions, in output it placed to key 'generated'. Keyword 'generated' showed only if column is generated.
3. Half of changelogs moved to ARCHIVE_CHANGELOG.txt
4. Added base support for CREATE DOMAIN statement
5. Added base support for CREATE SCHEMA [IF NOT EXISTS] ... [AUTHORIZATION] statement, added new type keyword 'schemas'
170 changes: 27 additions & 143 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Parser supports:
* Redshift
* Snowflake
* SparkSQL
* IBM DB2 dialect

You can check dialects sections after ``Supported Statements`` section to get more information that statements from dialects already supported by parser. If you need to add more statements or new dialects - feel free to open the issue.

Expand Down Expand Up @@ -449,6 +450,12 @@ Oracle
* ENCRYPT column property [+ NO SALT, SALT, USING]
* STORAGE column property

PotgreSQL
^^^^^^^^^


* INHERITS table statement - https://postgrespro.ru/docs/postgresql/14/ddl-inherit

AWS Redshift Dialect statements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -552,6 +559,26 @@ https://github.com/swiatek25
Changelog
---------

**v0.30.0**

Fixes:
^^^^^^


#. IDENTITY now parsed normally as a separate column property. Issue: https://github.com/xnuinside/simple-ddl-parser/issues/184

New Features:
^^^^^^^^^^^^^


#.
IN TABLESPACE IBM DB2 statement now is parsed into 'tablespace' key. Issue: https://github.com/xnuinside/simple-ddl-parser/issues/194.
INDEX IN also parsed to 'index_in' key.
Added support for ORGANIZE BY statement

#.
Added support for PostgreSQL INHERITS statement. Issue: https://github.com/xnuinside/simple-ddl-parser/issues/191

**v0.29.1**

Important updates:
Expand Down Expand Up @@ -964,146 +991,3 @@ New Features:
#### MSSQL
3. Added support for CONSTRAINT [CLUSTERED]... PRIMARY KEY for Table definition
4. Added support for WITH statement in CONSTRAINT (Table definition)
**v0.19.9**


#. Fixed issue with the weird log - https://github.com/xnuinside/simple-ddl-parser/issues/78.

**v0.19.8**
Features:

.. code-block::
1. Method `DDLParser(...).run(...)` now get argument json=True if you want to get result as json,
but not as Python Object
Fixes:

.. code-block::
1. Fixed issue when variables are 'glue' during Struct parse like previously STRUCT<a ARRAY<STRING>,b BOOL> was
extracted like 'STRUCT <aARRAY <STRING>,bBOOL>', now this issue was fixed and it parsed as is STRUCT < a
ARRAY < STRING > ,b BOOL >. Now '>' and '<' always will be with space near them.
2. CHECK CONSTRAINT with functions. Fix for https://github.com/xnuinside/simple-ddl-parser/issues/76.
**v0.19.7**
Fixes:


#. Add support for more special symbols to strings - https://github.com/xnuinside/simple-ddl-parser/issues/68

Features:


#. Added support for HQL statements:
STORED AS INPUTFORMAT, OUTPUTFORMAT - https://github.com/xnuinside/simple-ddl-parser/issues/69
SKEWED BY

**v0.19.6**
Fixes:


#. Fixed issue with PARTITIONED BY multiple columns in HQL - https://github.com/xnuinside/simple-ddl-parser/issues/66
#. Question symbol '?' now handled valid in strings - https://github.com/xnuinside/simple-ddl-parser/issues/64
#. Fixed issue with escaping symbols & added tests -https://github.com/xnuinside/simple-ddl-parser/issues/63

Features:


#. Added support for HQL statement TBLPROPERTIES - https://github.com/xnuinside/simple-ddl-parser/issues/65

**v0.19.5**
Fixes:


#. Fixed issues with COMMENT statement in column definitions. Add bunch of tests, now they expect working ok.

**v0.19.4**


#. Added support for PARTITION BY (previously was only PARTITIONED BY from HQL)

**v0.19.2**


#. Added support for ` quotes in column & tables names

**v0.19.1**
Fixes:


#. Issue with '\t' reported in https://github.com/xnuinside/simple-ddl-parser/issues/53

Features:


#. Added base for future BigQuery support: added output_mode="bigquery". Pay attention that there is no schemas in BigQuery, so schemas are Datasets.

**v0.19.0**
**Features**


#. Added support for base Snowflake SQL Dialect.
Added new --output-mode='snowflake' (add "clone" key)

Added support for CREATE .. CLONE with same behaviour as CREATE .. LIKE
Added support for CREATE .. CLONE for schemas and database - displayed in output as {"clone": {"from": ... }}
CREATE TABLE .. CLUSTER BY ..
CONSTRAINT .. [NOT] ENFORCED (value stored in 'primary_key_enforced')


#. in CREATE DATABASE properties that goes after name like key=value now parsed valid. Check examples in tests
#. Added support for varchar COLLATE column property

**v0.18.0**
**Features**


#. Added base support fot AWS Redshift SQL dialect.
Added support for ENCODE property in column.
Added new --output-mode='redshift' that add to column 'encrypt' property by default.
Also add table properties: distkeys, sortkey, diststyle, encode (table level encode), temp.

Supported Redshift statements: SORTKEY, DISTSTYLE, DISTKEY, ENCODE

CREATE TEMP / TEMPORARY TABLE

syntax like with LIKE statement:

create temp table tempevent(like event);

**v0.17.0**


#. All dependencies were updated for the latest version.
#. Added base support for CREATE [BIGFILE | SMALLFILE] [TEMPORARY] TABLESPACE
#. Added support for create table properties like ``TABLESPACE user_data ENABLE STORAGE IN ROW CHUNK 8K RETENTION CACHE``
#. Added support for CREATE DATABASE statement

**v0.16.3**


#. Fixed issue then using columns names equals some tokens like, for example, ``key`` caused the error.
But still words 'foreign' and 'constraint' as column names cause the empty result. I hope they rarely used.
Will be fixed in next releases.

**v0.16.2**


#. Fixed issue with enum in lowercase

**v0.16.0**


#. Fixed the issue when NULL column after DEFAULT used as default value.
#. Added support for generated columns, statatements: AS , GENERATED ALWAYS, STORED in Column Defenitions, in output it placed to key 'generated'. Keyword 'generated' showed only if column is generated.
#. Half of changelogs moved to ARCHIVE_CHANGELOG.txt
#. Added base support for CREATE DOMAIN statement
#. Added base support for CREATE SCHEMA [IF NOT EXISTS] ... [AUTHORIZATION] statement, added new type keyword 'schemas'
10 changes: 1 addition & 9 deletions simple_ddl_parser/dialects/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,6 @@ def p_create_database(self, p: List) -> None:
p[0] = {f"{p[2].lower()}_name": p_list[-1]}


class Truncate:
def p_expression_drop_table(self, p: List) -> None:
"""expr : TRUNCATE t_name
"""
p_list = list(p)
p[0] = {"truncate": {"schema": p_list[-1]['schema'], "table_name": p_list[-1]['table_name']}}


class Drop:
def p_expression_drop_table(self, p: List) -> None:
"""expr : DROP TABLE id
Expand Down Expand Up @@ -700,7 +692,7 @@ def p_domain_name(self, p: List) -> None:


class BaseSQL(
Database, Table, Drop, Truncate, Domain, Column, AfterColumns, Type, Schema, TableSpaces
Database, Table, Drop, Domain, Column, AfterColumns, Type, Schema, TableSpaces
):
def clean_up_id_list_in_equal(self, p_list: List) -> List: # noqa R701
if isinstance(p_list[1], str) and p_list[1].endswith("="):
Expand Down
1 change: 0 additions & 1 deletion simple_ddl_parser/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"CLUSTERED": "CLUSTERED",
"SEQUENCE": "SEQUENCE",
"TABLESPACE": "TABLESPACE",
"TRUNCATE": "TRUNCATE",
}
common_statements = {
"INDEX": "INDEX",
Expand Down

0 comments on commit ba0acc3

Please sign in to comment.