Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Commit

Permalink
Add aliases to register_(hstore|json) methods for use with NamedTuples
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Kutikin committed Aug 3, 2015
1 parent 99f69b9 commit 87a4a7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions momoko/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ def register_hstore(self, globally=False, unicode=False):
registrator = partial(_psy_register_hstore, None, globally, unicode)
callback = partial(self._register, future, registrator)
self.ioloop.add_future(self.execute(
"SELECT 'hstore'::regtype::oid, 'hstore[]'::regtype::oid",
"SELECT 'hstore'::regtype::oid AS hstore_oid, 'hstore[]'::regtype::oid AS hstore_arr_oid",
), callback)

return future
Expand Down Expand Up @@ -915,7 +915,7 @@ def register_json(self, globally=False, loads=None):
registrator = partial(_psy_register_json, None, globally, loads)
callback = partial(self._register, future, registrator)
self.ioloop.add_future(self.execute(
"SELECT 'json'::regtype::oid, 'json[]'::regtype::oid"
"SELECT 'json'::regtype::oid AS json_oid, 'json[]'::regtype::oid AS json_arr_oid"
), callback)

return future
Expand Down

0 comments on commit 87a4a7b

Please sign in to comment.