Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def main():
async with aiopg.create_pool(dsn) as pool:
async with pool.acquire() as conn:
async with conn.cursor() as cur:
await cur.execute('CREATE TABLE tbl (id int)')
await transaction(cur, IsolationLevel.repeatable_read)
await transaction(cur, IsolationLevel.read_committed)
await transaction(cur, IsolationLevel.serializable)
await cur.execute('select * from tbl')
async def main():
pool = await aiopg.create_pool(dsn)
async with pool.cursor() as cur:
await transaction(cur, IsolationLevel.repeatable_read)
await transaction(cur, IsolationLevel.read_committed)
await transaction(cur, IsolationLevel.serializable)
cur.execute('select * from tbl')
async def main():
async with aiopg.create_pool(dsn) as pool:
async with pool.acquire() as conn:
async with conn.cursor() as cur:
await cur.execute('CREATE TABLE tbl (id int)')
await transaction(cur, IsolationLevel.repeatable_read)
await transaction(cur, IsolationLevel.read_committed)
await transaction(cur, IsolationLevel.serializable)
await cur.execute('select * from tbl')
def __init__(self, conn, impl, timeout, echo):
self._conn = conn
self._impl = impl
self._timeout = timeout
self._echo = echo
self._transaction = Transaction(self, IsolationLevel.repeatable_read)
async def main():
pool = await aiopg.create_pool(dsn)
async with pool.cursor() as cur:
await transaction(cur, IsolationLevel.repeatable_read)
await transaction(cur, IsolationLevel.read_committed)
await transaction(cur, IsolationLevel.serializable)
cur.execute('select * from tbl')
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)