From 15ac98b7bbc1bb9a527692916233c1f37d9d5990 Mon Sep 17 00:00:00 2001 From: Dmitry Maslennikov Date: Wed, 24 May 2023 23:05:25 +0400 Subject: [PATCH] fixed bug when table not in lowercase --- sqlalchemy_iris/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sqlalchemy_iris/base.py b/sqlalchemy_iris/base.py index c3e9ddb..c17125e 100644 --- a/sqlalchemy_iris/base.py +++ b/sqlalchemy_iris/base.py @@ -11,6 +11,7 @@ from sqlalchemy.sql import func from sqlalchemy.sql.functions import ReturnTypeFromArgs from sqlalchemy.sql.elements import Null +from sqlalchemy.sql.elements import quoted_name from sqlalchemy.sql import expression from sqlalchemy.sql import schema from sqlalchemy import sql, text @@ -1676,3 +1677,8 @@ def get_view_definition(self, connection, view_name, schema=None, **kw): if view_def: return view_def raise exc.NoSuchTableError(f"{schema}.{view_name}") + + def normalize_name(self, name): + if self.identifier_preparer._requires_quotes(name): + return quoted_name(name, quote=True) + return name