turbodbc icon indicating copy to clipboard operation
turbodbc copied to clipboard

Support for SQL_GUID type

Open dirkjonker opened this issue 7 years ago • 10 comments

Querying a MS SQL Server table that has a SQL_GUID type column will make turbodbc raise a RuntimeError:

  File "/Users/Dirkjonker/venv/lib/python3.5/site-packages/turbodbc/exceptions.py", line 31, in wrapper
    return f(*args, **kwds)
  File "/Users/Dirkjonker/venv/lib/python3.5/site-packages/turbodbc/cursor.py", line 72, in execute
    self.impl.execute()
RuntimeError: Error! Unsupported type identifier '-11'

$ grep "(-11)" /usr/local/include/sql*.h
/usr/local/include/sqlext.h:#define SQL_GUID                            (-11)

For our use case, returning the GUID as a string or bytestring would be sufficient.

dirkjonker avatar Mar 23 '17 14:03 dirkjonker

This seems related to #56.

MathMagique avatar Mar 23 '17 14:03 MathMagique

It would be even better if turbodbc returned a proper Python UUID though.

keitherskine avatar Mar 23 '17 14:03 keitherskine

Hello, I am curious is there any traction in the pipeline for resolving this issue in an upcoming version release?

kyleaclark avatar Jan 08 '18 20:01 kyleaclark

Hi Kyle! Traction was a bit low in the recent past. This was mostly because I as the main contributor became a father and switched positions. I expect to spend more time on turbodbc in the future. Fixing bugs/compatibility issues and adding support for more data types such as SQL_GUID is at the top of my mental list.

MathMagique avatar Jan 09 '18 07:01 MathMagique

Hi Michael, thank you for getting back to me. I appreciate your time and effort in the open source contributions of turbodbc. Looking forward to future updates.

kyleaclark avatar Jan 09 '18 20:01 kyleaclark

I been using turbodbc for creating parquet from sql server, the non support sql_guid seems a big road block on my work, Is this feature being actively pursued?

ocpgiridreams avatar Jul 24 '18 20:07 ocpgiridreams

Hi! I have been planning to add support for more data types for more than a year now, but my time is rather limited, currently.

A pull request would require:

  • extending the type enum
  • add read/write support for plain Python objects
  • add read/write support for NumPy frontend
  • add read/write support for Arrow frontend

MathMagique avatar Jul 26 '18 09:07 MathMagique

@dirkjonker I have the same issue. As a workaround you can always cast the GUID to a string as a part of the SQL query. Then cast it back to a UUID when you process the result set in your code. Not ideal, but it gets us around the roadblock in the interim. Good luck!

And Michael, thanks again for your time and effort on turbodbc!!

tmitrovich avatar Jan 30 '19 16:01 tmitrovich

Thank you.

On Jan 30, 2019, at 11:04 AM, tmitrovich [email protected] wrote:

@dirkjonker https://github.com/dirkjonker I have the same issue. As a workaround you can always cast the GUID to a string as a part of the SQL query. Then cast it back to a UUID when you process the result set in your code. Not ideal, but it gets us around the roadblock in the interim. Good luck!

And Michael, thanks again for your time and effort on turbodbc!!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blue-yonder/turbodbc/issues/65#issuecomment-459000648, or mute the thread https://github.com/notifications/unsubscribe-auth/Ah0Mefne67xbPldBVX6cXXrgWSFWBu0lks5vIcKLgaJpZM4Mm0Fr.

ocpgiridreams avatar Jan 30 '19 21:01 ocpgiridreams

I was trying to pull around 10000 rows x 20 columns records from Microsoft SQL Server using turbodbc. But I've received below error response.

Unsupported type identifier for column LINE_PK @ SQL_GUID (precision 36, scale 0)

MugiJR avatar Apr 23 '20 07:04 MugiJR