INNER CODE UNIT · Python
CustomEncoder
evangelosmeklis/peepdb · peepdb/cli.py:16
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, Decimal):
return float(obj)
elif isinstance(obj, date):
return obj.isoformat()
return super(CustomEncoder, self).default(obj)
@click.group()
@click.version_option()
def cli():
"""
peepDB: A quick database table viewer.
This tool allows you to quickly inspect database tables without writing SQL queries.
It supports MySQL, PostgreSQL, MariaDB, SQLite, MongoDB, Firebase, MSSQL, and OracleDB.