Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

engine.dialect.has_schema does not work #1312

Closed
leo-schick opened this issue Dec 15, 2023 · 1 comment
Closed

engine.dialect.has_schema does not work #1312

leo-schick opened this issue Dec 15, 2023 · 1 comment

Comments

@leo-schick
Copy link

Environment

  • Python: Python 3.10.13 64 bit
  • pyodbc: pyodbc==5.0.1
  • OS: linux
  • DB: SQL Server
  • driver: ODBC Driver 18 for SQL Server

Issue

The method sqlalchemy.engine.Dialect.has_schema is not implemented in pyodbc.

@leo-schick leo-schick changed the title engine.dialect.has_schema is not supported engine.dialect.has_schema does not work Dec 15, 2023
@gordthompson
Copy link
Collaborator

That method is part of the SQLAlchemy dialect. The documentation you cite says

This is an internal dialect method. Applications should use Inspector.has_schema().

and that does work:

import sqlalchemy as sa

engine = sa.create_engine("mssql+pyodbc://scott:tiger^5HHH@mssql_199")

insp = sa.inspect(engine)
print(insp.has_schema("dbo"))  # True
print(insp.has_schema("non_existent"))  # False

@gordthompson gordthompson closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2023
leo-schick added a commit to mara/mara-catalog that referenced this issue Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants