From f5b425ae2941fd14e59500f50eb48674af958f45 Mon Sep 17 00:00:00 2001 From: XD09 Date: Sun, 19 Jul 2020 00:27:20 +0800 Subject: [PATCH] Update usage.rst (#572) fix hstore example error, change con to conn --- docs/usage.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage.rst b/docs/usage.rst index 20da9d00..9a88d2ca 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -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())