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

Use paramstyle #56

Closed
Jaymon opened this issue Nov 1, 2017 · 1 comment
Closed

Use paramstyle #56

Jaymon opened this issue Nov 1, 2017 · 1 comment

Comments

@Jaymon
Copy link
Owner

Jaymon commented Nov 1, 2017

Instead of specifically setting the param in SQLite and PostgreSQL, use paramstyle and have the base class handle setting the value.

via

@Jaymon
Copy link
Owner Author

Jaymon commented Dec 13, 2017

This would work but it is about the same amount of cognitive overhead, in order to use this you need to do:

import sqlite3

print(sqlite3.paramstyle)

So for the base class to use this the child classes would need to set the module, something like:

import sqlite3

class SQLite(SQLInterface):
      connection_module = sqlite3

and then the base interface can use connection_module to check paramstyle. But that's just as much work as setting the val_placeholder manually so it's probably not worth doing. If we ever implement an interface that uses one of the more exotic styles like numeric, named or pyformat then there will be a bit of refactoring in lots of places and at that point it might be worth implementing this

@Jaymon Jaymon closed this as completed in 0bc0e39 Mar 24, 2023
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

1 participant