Closed cswingle closed 9 years ago
I notice my pull request doesn't build with psycopg2ct
because there is no register_json
function for that library. According to the docs, it's unmaintained and suggests using psycopg2cffi
, which does include register_json
, and which works with my code changes. Is psycopg2ct
support a requirement here?
I've inherited psycopg2ct
support, so I don't know why it was introduced originally. Frank, can you provide some information on the subject?
I think we can drop support for psycopg2ct if it isn't maintained anymore.
Agreed. I've got rid of psycopg2ct in Travi CI.
@cswingle, Please rebase on master and create new your pull request - I want to make sure that Travis build passes.
Adds a
register_json
method toConnection
andPool
classes.I copied the
register_hstore
code, changing theunicode
argument toloads
forregister_json
and attempted to update the test and docs. I tested it with the code where I needed this function, and it was able to readjson
data from the database (9.3) and convert to a Python dict, exactly as I needed. I haven't tested it's ability to write JSON. In my experiments withpsycopg2
it seemed like writing to the database required wrapping the Python object withpsycopg2.extras.Json(dict)
, but I am probably missing something.