From 59f2d0c96152128d8e02e43dcda045593153c86e Mon Sep 17 00:00:00 2001 From: Mike Barry Date: Wed, 26 Oct 2022 13:40:32 -0400 Subject: use only object_id() function for temp tables Fixed issue with :meth:`.Inspector.has_table` when used against a temporary table for the SQL Server dialect would fail an invalid object name error on some Azure variants, due to an unnecessary information schema query that is not supported on those server versions. Pull request courtesy Mike Barry. the patch also fills out test support for has_table() against temp tables, temp views, adding to the has_table() support just added for views in #8700. Fixes: #8714 Closes: #8716 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8716 Pull-request-sha: e2ac7a52e2b09a349a703ba1e1a2911f4d3c0912 Change-Id: Ia73e4e9e977a2d6b7e100abd2f81a8c8777dc9bb --- lib/sqlalchemy/testing/requirements.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/sqlalchemy/testing/requirements.py') diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 1d6f1103d..8ceb2af2f 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -709,6 +709,11 @@ class SuiteRequirements(Requirements): """target dialect supports listing of temporary table names""" return exclusions.closed() + @property + def has_temp_table(self): + """target dialect supports checking a single temp table name""" + return exclusions.closed() + @property def temporary_tables(self): """target database supports temporary tables""" -- cgit v1.2.1