MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / get_connection_spec

Method get_connection_spec

asyncpg/_testbase/__init__.py:350–360  ·  view source on GitHub ↗
(cls, kwargs={})

Source from the content-addressed store, hash-verified

348
349 @classmethod
350 def get_connection_spec(cls, kwargs={}):
351 conn_spec = cls.cluster.get_connection_spec()
352 if kwargs.get('dsn'):
353 conn_spec.pop('host')
354 conn_spec.update(kwargs)
355 if not os.environ.get('PGHOST') and not kwargs.get('dsn'):
356 if 'database' not in conn_spec:
357 conn_spec['database'] = 'postgres'
358 if 'user' not in conn_spec:
359 conn_spec['user'] = 'postgres'
360 return conn_spec
361
362 @classmethod
363 def connect(cls, **kwargs):

Callers 6

create_poolMethod · 0.95
connectMethod · 0.45
setUpClassMethod · 0.45
get_connection_specMethod · 0.45
setup_clusterMethod · 0.45

Calls 1

getMethod · 0.80

Tested by

no test coverage detected