Simple-ddl-parser

Latest version: v1.1.0

Safety actively analyzes 622217 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 12

1.1.0

Improvements
MySQL:
1. Added support for INDEX statement inside table definition
2. Added support for MySQL INVISIBLE/VISIBLE statement - https://github.com/xnuinside/simple-ddl-parser/issues/243

Snowflake:
1. Added support for cluster by statement before columns definition - https://github.com/xnuinside/simple-ddl-parser/issues/234

1.0.4

Improvements
1. Support functions with schema prefix in `DEFAULT` and `CHECK` statements. https://github.com/xnuinside/simple-ddl-parser/issues/240
Fixes
1. Fix for REFERENCES NOT NULL - https://github.com/xnuinside/simple-ddl-parser/issues/239
2. Fix for snowflake stage name location format bug fix - https://github.com/xnuinside/simple-ddl-parser/pull/241

1.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.

1.0.2

Improvements
1. Fixed bug with places first table property value in 'authorization' key. Now it is used real property name.
2. Fixed typo on Databricks dialect
3. improved equals symbols support within COMMENT statement.
4. turn regexp into functions

MySQL Improvements
1. UNSIGNED property after int parsed validly now

Snowflake
1. Snowflake TAG now available on SCHEMA definitions.

1.0.1

Minor Fixes
1. When using `normalize_names=True` do not remove `[]` from types like `decimal(21)[]`.
2. When using `normalize_names=True` ensure that `"complex"."type"` style names convert to `complex.type`.

1.0.0

In output structure was done important changes that can in theory breaks code.

Important changes
1. Important change:

all custom table properties that are defined after column definition in 'CREATE TABLE' statement and relative to only one dialect (only for SparkSQL, or HQL,etc), for example, like here:
https://github.com/xnuinside/simple-ddl-parser/blob/main/tests/dialects/test_snowflake.py#L767 or https://github.com/xnuinside/simple-ddl-parser/blob/main/tests/dialects/test_spark_sql.py#L133 will be saved now in property `table_properties` as dict.
Previously they was placed on same level of table output as `columns`, `alter`, etc. Now, they grouped and moved to key `table_properties`.

2. Formatting parser result now represented by 2 classes - Output & TableData, that makes it more strict and readable.

3. The output mode now functions more strictly. If you want to obtain output fields specific to a certain dialect,
use output_mode='snowflake' for Snowflake or output_mode='hql' for HQL, etc.
Previously, some keys appeared in the result without being filtered by dialect.
For example, if 'CLUSTER BY' was in the DDL, it would show up in the 'cluster_by' field regardless of the output mode.
However, now all fields that only work in certain dialects and are not part of the basic SQL notation will only be shown
if you choose the correct output_mode.


New Dialects support
1. Added as possible output_modes new Dialects:
- Databricks SQL like 'databricks',
- Vertica as 'vertica',
- SqliteFields as 'sqlite',
- PostgreSQL as 'postgres'

Full list of supported dialects you can find in dict - `supported_dialects`:

`from simple_ddl_parser import supported_dialects`

Currently supported: ['redshift', 'spark_sql', 'mysql', 'bigquery', 'mssql', 'databricks', 'sqlite', 'vertics', 'ibm_db2', 'postgres', 'oracle', 'hql', 'snowflake', 'sql']

If you don't see dialect that you want to use - open issue with description and links to Database docs or use one of existed dialects.

Snowflake updates:
1. For some reasons, 'CLONE' statement in SNOWFLAKE was parsed into 'like' key in output. Now it was changed to 'clone' - inner structure of output stay the same as previously.

MySQL updates:
1. Engine statement now parsed correctly. Previously, output was always '='.

BigQuery updates:
1. Word 'schema' totally removed from output. `Dataset` used instead of `schema` in BigQuery dialect.

Page 1 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.