Skip to content

Conversation

@clutchski
Copy link
Contributor

register_type performs c-level type checks of connections, so we need to be sure to transparently downgrade passed in connections.

needs to be patched globally even if we are wrapping a single connection.

this function does c-level checks of the type of the argument
so it must be a raw psycopg connection passed in. this adds
a hook to transparently downgrade.
name = _get_vendor(conn)
self._datadog_pin = Pin(service=name, app=name)

def execute(self, *args, **kwargs):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will move this to a sqlite specific class. it was breaking this test:

https://github.com/psycopg/psycopg2/blob/51aa166d5219bf6bcda1f68f33399c930113a1f1/lib/extras.py#L762-L767

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that possible that this shared pdbapi will break again? Should we move it all to lib-specific contrib? (even if it implies code duplication).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea it's an option. i want to experiment with this a bit though.

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

Successfully merging this pull request may close these issues.

3 participants