How to use the aiopg.pool.create_pool function in aiopg

To help you get started, we’ve selected a few aiopg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aio-libs / aiopg / aiopg / __init__.py View on Github external
micro = int(match.group('micro'))
        levels = {'c': 'candidate',
                  'a': 'alpha',
                  'b': 'beta',
                  None: 'final'}
        releaselevel = levels[match.group('releaselevel')]
        serial = int(match.group('serial')) if match.group('serial') else 0
        return VersionInfo(major, minor, micro, releaselevel, serial)
    except Exception:
        raise ImportError("Invalid package version {}".format(ver))


version_info = _parse_version(__version__)

# make pyflakes happy
(connect, create_pool, Connection, Cursor, Pool, DEFAULT_TIMEOUT,
 IsolationLevel, Transaction)
github simonwittber / netwrok-server / src / netwrok / nwdb.py View on Github external
def get_connection(dsn):
    pool = pools.get(dsn, None)
    if pool is None:
        pool = pools[dsn] = yield from create_pool(dsn)
    conn = yield from pool
    return conn
github aio-libs / aiopg / aiopg / sa.py View on Github external
def create_pool(dsn=None, *, minsize=10, maxsize=10,
                loop=None, **kwargs):
    return (yield from base_create_pool(dsn,
                                        minsize=minsize,
                                        maxsize=maxsize,
                                        loop=loop,
                                        _connection_factory=SAConnection,
                                        **kwargs))