-
-
Notifications
You must be signed in to change notification settings - Fork 363
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
Fix checks for whether a database type is installed #1050
Comments
@mathemancer To be clear, is the problem that we're using Is this def get_available_types(engine):
"""
Returns a dict where the keys are database type names defined on the database associated with
provided Engine, and the values are their SQLAlchemy classes.
"""
return engine.dialect.ischema_names Below is what I did to get the installed functions. def _get_functions_defined_on_database(engine):
metadata = MetaData()
pg_proc = Table('pg_proc', metadata, autoload_with=engine, schema='pg_catalog')
select_statement = select(pg_proc.c.proname)
return tuple(
function_name
for function_name, in engine.connect().execute(select_statement)
) Is the solution to do the same for types? |
This issue has not been updated in 90 days and is being marked as stale. |
Problem description
While reviewing #1022, @mathemancer noticed that some of our methods used to determine whether or not a database type is installed on the database are problematic. The following comment by @mathemancer gives hints:
Mentioned code areas:
db/types/base.py::get_available_types
;db/types/operations/cast.py
.Expected outcome
Refactor relevant files and methods to have an accurate picture of which types are installed (on a given database) and which are not.
The text was updated successfully, but these errors were encountered: