edgedb-python
edgedb-python copied to clipboard
Make `create_client()` return a singleton client
We've discussed this multiple times, time to do it.
create_client() and create_async_client() should create a client once upon the first call (one sync singleton and one async singleton respectively) and follow on calls should just return that first thing.
- Add
detached=Falseargument to force creating a new client when flipped toTrue - Obviously singletons should be partitioned by connection arguments
- Use
weakref.WeakValueDictionaty[ConnectionSpec, Client]
@elvis and @msullivan will discuss this and update this issue