MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / hstore_decoder

Method hstore_decoder

tests/test_codecs.py:1192–1199  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

1190 ''')
1191
1192 def hstore_decoder(data):
1193 result = {}
1194 items = data.split(',')
1195 for item in items:
1196 k, _, v = item.partition('=>')
1197 result[k.strip('"')] = v.strip('"')
1198
1199 return result
1200
1201 def hstore_encoder(obj):
1202 return ','.join('{}=>{}'.format(k, v) for k, v in obj.items())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected