simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.67k stars 111 forks source link

Custom JSON encoder #521

Open janrito opened 1 year ago

janrito commented 1 year ago

It would be nice if we could specify a custom encoder (and decoder) for types that will need extra deserialisation – e.g., sets, enums or sparse matrices – or even project-specific types

rsyring commented 9 months ago

I would also like to see this possibility. I suggest (#612) using a method on Database so it can be easily subclassed. Another option would be to pass in callables to Database() for json serialization and deserialization.