diff --git a/CHANGELOG.md b/CHANGELOG.md index 82ddc25..70bd34c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.32.0] - 2024-09-24 + +- Introduced basic "elapsed timers" for performance debugging. Can be enabled with `--show-timers` CLI parameter. +- Added basic support for `VECTOR` type. It can be used for `TABLE`, but not for `FUNCTION` or `PROCEDURE` due to issues with overloading. +- Converting tables with auto-increment now recognizes `ORDER` and `NOORDER` flags. +- Converting views without newline after `AS` is now possible. + ## [0.31.2] - 2024-09-05 - Implemented custom `__eq__` method to check `Grants`. It helps to take into account edge case for `INTEGRATION` object grants not returning specific integration type from `SHOW GRANTS` command. diff --git a/snowddl/converter/table.py b/snowddl/converter/table.py index f3109f7..49b0468 100644 --- a/snowddl/converter/table.py +++ b/snowddl/converter/table.py @@ -9,8 +9,7 @@ cluster_by_syntax_re = compile(r"^(\w+)?\((.*)\)$") collate_type_syntax_re = compile(r"^(.*) COLLATE \'(.*)\'$") -identity_re = compile(r"^IDENTITY START (\d+) INCREMENT (\d+)$") - +identity_re = compile(r"^IDENTITY START (\d+) INCREMENT (\d+) (ORDER|NOORDER)$") class TableConverter(AbstractSchemaObjectConverter): def get_object_type(self) -> ObjectType: @@ -132,6 +131,7 @@ def _get_columns(self, row): identities[sequence_name] = { "start": int(i.group(1)), "interval": int(i.group(2)), + "is_ordered": i.group(3) == "ORDER", } elif str(c["default"]).upper().endswith(".NEXTVAL"): col["default_sequence"] = self._normalise_name_with_prefix(str(c["default"])[:-8]) diff --git a/snowddl/converter/view.py b/snowddl/converter/view.py index 10fcce5..ba3f587 100644 --- a/snowddl/converter/view.py +++ b/snowddl/converter/view.py @@ -8,7 +8,7 @@ from snowddl.parser.view import view_json_schema -view_text_re = compile(r"^.*\sas\n(.*)$", DOTALL) +view_text_re = compile(r"^.*\sas(\n|\s)+(.*)$", DOTALL) class ViewConverter(AbstractSchemaObjectConverter): @@ -83,7 +83,7 @@ def _get_text_or_include(self, object_path: Path, row: dict): ) view_ddl = cur.fetchone()["VIEW_DDL"] - view_text = view_text_re.sub(r"\1", view_ddl).strip(" \n\r\t()") + view_text = view_text_re.sub(r"\2", view_ddl).rstrip(";").strip(" \n\r\t()") # Remove trailing spaces from each line to prevent output formatting issues # https://github.com/yaml/pyyaml/issues/411 diff --git a/snowddl/version.py b/snowddl/version.py index 724f89d..13844a7 100644 --- a/snowddl/version.py +++ b/snowddl/version.py @@ -1 +1 @@ -__version__ = "0.31.2" +__version__ = "0.32.0"