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

Things to document / Compat with pyodbc #133

Open
aersam opened this issue Apr 21, 2022 · 1 comment
Open

Things to document / Compat with pyodbc #133

aersam opened this issue Apr 21, 2022 · 1 comment

Comments

@aersam
Copy link
Contributor

aersam commented Apr 21, 2022

Hi there
Thanks for this great library! I did use it in a project where I used pyodbc before and there are some non-obvious things I think you should document. I must say however that I am relatively new to python database related stuff.

At first pyodbc has some nice extensions to the DB API I think you should consider, mostly this one: https://github.com/mkleehammer/pyodbc/wiki/Features-beyond-the-DB-API#passing-parameters

The second thing is that only the %s Parameter Syntax seems to work though the DB API mentions some more syntax types. I think you should document what you support here.

@jholladay10
Copy link

I'm just an interloper trying to help. I also struggled with parameters when I started using this library due to my inexperience with python and this type of string formatting (the documentation now refers to this as "printf-style string formatting" and "old string formatting") while frantically trying to get things working. In the Python DB 2.0 specification there's a paramstyle global (found in in pytds/__init__.py for this library) that indicates the parameter style supported by the library. pytds has this as "pyformat". So, technically speaking, it's documented. You can then go from there to this string formatting specification to see how this works. However, when you delve into the pytds code, this formatting is only used to replace the formatting placeholders with generated sql server variable names (@p1, @p2, etc.), so %s or %(name)s are really the only viable format specifiers.

Hope that helps.

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