News for hackers. Stuff that matters.
Re:Coherent Python and PostgreSQL Enums Using SQLAlchemy by threadthread on Friday July 02, 2021 @03:58PM (#27716096)
Getting a database to line up with production code is especially important in python as pep 484 types become more commonplace. If you trust the type annotations but the database/orm is polluting data structures with values that don’t conform to the annotations, you’ve lost a lot of the annotation work’s leverage.
Re:Coherent Python and PostgreSQL Enums Using SQLAlchemy by code4you on Friday July 02, 2021 @03:14PM (#27715583)
Very useful - I've had bugs due to incorrect strings entering enum like values the database and I imagine using db-checked enums like this would have saved me some huge headaches
Re:Coherent Python and PostgreSQL Enums Using SQLAlchemy by avikej on Friday July 02, 2021 @03:09PM (#27715517)
Nice read! I've found it to be tricky to maintain definition consistencies between Python/SQLAlchemy, so this will definitely come in handy :D