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

Add Connection class, to allow for non-global use. #62

Closed
wants to merge 3 commits into from

Conversation

tseaver
Copy link

@tseaver tseaver commented Jan 21, 2014

Preserve global APIs 'setup', 'execute_query', etc., using a global instance of that class.

'Vertex' and 'Element' subclasses can be assigned an instance via '_set_connection', or have one passed in the class suite as '_connection'; in either case the global instance will be ignored (and need not even be configured).

Making the classes independent of the connection would be even more flexible, but would involve moving all the class methods, as well as the instance construction, to the connection object.

Preserve global APIs 'setup', 'execute_query', etc., using a global
instance of that class.
Allows passing the connection through explicitly, rather than relying
on global or class defaults.  This should allow for connection-pooling,
as well as having different connections used in different parts of the
application.
@tseaver tseaver closed this by deleting the head repository Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant