Skip to content

Commit

Permalink
Update usage.rst (#572)
Browse files Browse the repository at this point in the history
fix hstore example error, change con to conn
  • Loading branch information
xuedong09 committed Jul 18, 2020
1 parent 745f8f8 commit f5b425a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/usage.rst
Expand Up @@ -318,9 +318,9 @@ be registered on a connection using :meth:`Connection.set_builtin_type_codec()
async def run():
conn = await asyncpg.connect()
# Assuming the hstore extension exists in the public schema.
await con.set_builtin_type_codec(
await conn.set_builtin_type_codec(
'hstore', codec_name='pg_contrib.hstore')
result = await con.fetchval("SELECT 'a=>1,b=>2'::hstore")
result = await conn.fetchval("SELECT 'a=>1,b=>2'::hstore")
assert result == {'a': 1, 'b': 2}
asyncio.get_event_loop().run_until_complete(run())
Expand Down

0 comments on commit f5b425a

Please sign in to comment.