From f3013b7cb4cf7a28c47569b038586ea1ebd6d0fb Mon Sep 17 00:00:00 2001 From: Adam Liddell Date: Tue, 10 Dec 2019 15:15:47 +0000 Subject: [PATCH 1/2] Fix test case for HStore decode --- docs/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage.rst b/docs/usage.rst index 9a88d2ca..72e32184 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -321,7 +321,7 @@ be registered on a connection using :meth:`Connection.set_builtin_type_codec() await conn.set_builtin_type_codec( 'hstore', codec_name='pg_contrib.hstore') result = await conn.fetchval("SELECT 'a=>1,b=>2'::hstore") - assert result == {'a': 1, 'b': 2} + assert result == {'a': '1', 'b': '2'} asyncio.get_event_loop().run_until_complete(run()) From c585001b2e97b618d5174c0037ef169e9585e64c Mon Sep 17 00:00:00 2001 From: Adam Liddell Date: Tue, 10 Dec 2019 15:18:07 +0000 Subject: [PATCH 2/2] Add HStore NULL to None conversion example --- docs/usage.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage.rst b/docs/usage.rst index 72e32184..3c835ece 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -320,8 +320,8 @@ be registered on a connection using :meth:`Connection.set_builtin_type_codec() # Assuming the hstore extension exists in the public schema. await conn.set_builtin_type_codec( 'hstore', codec_name='pg_contrib.hstore') - result = await conn.fetchval("SELECT 'a=>1,b=>2'::hstore") - assert result == {'a': '1', 'b': '2'} + result = await conn.fetchval("SELECT 'a=>1,b=>2,c=>NULL'::hstore") + assert result == {'a': '1', 'b': '2', 'c': None} asyncio.get_event_loop().run_until_complete(run())