gordthompson / sqlalchemy-sybase

SAP ASE (Sybase) support for SQLAlchemy implemented as an external dialect
MIT License
12 stars 4 forks source link

Different format of returned values from database #12

Open josomir opened 1 year ago

josomir commented 1 year ago

I am getting a following stack trace when I try calling get_schema_names()

 File "venv/lib/python3.8/site-packages/sqlalchemy/engine/reflection.py", line 2000, in run
    res = meth(filter_names=_fn, **kw)
  File ".venv/lib/python3.8/site-packages/sqlalchemy/engine/reflection.py", line 1104, in get_multi_foreign_keys
    return dict(
  File ".venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 918, in _default_multi_reflect
    single_tbl_method(
  File "<string>", line 2, in get_foreign_keys
  File ".venv/lib/python3.8/site-packages/sqlalchemy/engine/reflection.py", line 97, in cache
    ret = fn(self, con, *args, **kw)
  File ".venv/lib/python3.8/site-packages/sqlalchemy_sybase/base.py", line 917, in get_foreign_keys
    table_info["schema"] = reftable["schema"]
  File "lib/sqlalchemy/cyextension/resultproxy.pyx", line 68, in sqlalchemy.cyextension.resultproxy.BaseRow.__getitem__

Issue is that get_schema_names is expecting a dictionary but now it is getting a tuple. I already have a fix for that so I can create a PR.

It has been tested with ASE database version 16.0 SP03 PL02/EBF

gordthompson commented 1 month ago

11