-
Notifications
You must be signed in to change notification settings - Fork 419
Problem with create_pool example from API #74
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
Labels
Comments
You cannot use |
On Thu, Feb 02, 2017 at 05:32:04AM -0800, Elvis Pranskevichus wrote:
You cannot use ``await`` outside of an ``async def`` function. The doc example is an excerpt. We'll tweak it for clarity.
Thanks Elvis.
Regards
Johann
…--
Johann Spies Telefoon: 021-808 4699
Databestuurder / Data manager Faks: 021-883 3691
Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology
Universiteit Stellenbosch.
The integrity and confidentiality of this email is governed by these terms / Hierdie terme bepaal die integriteit en vertroulikheid van hierdie epos. http://www.sun.ac.za/emaildisclaimer
|
Hallo Elvis,
Is there a mailing list or forum where I can ask questions about the
usage of asyncpg?
Regards
Johann
--
Johann Spies Telefoon: 021-808 4699
Databestuurder / Data manager Faks: 021-883 3691
Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology
Universiteit Stellenbosch.
The integrity and confidentiality of this email is governed by these terms / Hierdie terme bepaal die integriteit en vertroulikheid van hierdie epos. http://www.sun.ac.za/emaildisclaimer
|
@johannspies We have no mailing list dedicated to asyncpg currently. It would probably be best to ask for help and guidance on usage on Stack Overflow. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
python3-asyncpg 0.8.4-1 amd64
postgresql-9.6 9.6.1-2 amd64
python3-ipython 5.1.0-3
python3 3.5.3-1 amd64
Linux 4.8.0-2-amd64 Other examples? #1 SMP Debian 4.8.15-2 (2017-01-04) x86_64 GNU/Linux (Debian testing/sid)
(if locally, which version of Cython was used)?: No
uvloop?:
I do not know.
Examples from the API causes syntax errors:
and (in jupyter notebook)
async with asyncpg.create_pool(user='postgres',
command_timeout=60) as pool:
async with pool.acquire() as con:
await con.fetch('SELECT 1')
File "", line 1
async with asyncpg.create_pool(user='postgres',
^
SyntaxError: invalid syntax
While I can do other stuff like this without a problem:
async def xmlrecord(db,schema,tb):
"""Get one xml record from wos_source.cover_2016"""
conn = await asyncpg.connect(database=db,
user='xxxxxx',
password='xxxxxx',
host='localhost')
x = """
SELECT ut, xml from {}.{} where processed is not true limit 1;
""".format(schema, tb)
stmt = await conn.prepare(x)
result = await stmt.fetch()
ut = result[0]['ut']
xml = result[0]['xml']
return ut,xml
The text was updated successfully, but these errors were encountered: