News for hackers. Stuff that matters.
Re:What I Learned from Making the Python Back End for My New... by bb88 on Friday October 18, 2024 @02:42PM (#41882265)
There's a lot to like about the Django ORM. And Django still has it's place.

What I'd like is a SQL that creates and consumes a JSON structure as output/input, and then there wouldn't really be a need to serialize/deserialize anything. Python would be a lightweight wrapper for authentication, error handling, logging, and data processing that couldn't be easily done with SQL.

I mean people are trying this, but SQL feels so arcane. If you have tabular data and working with spreadsheets, SQL is great. And the JSON support in postgres is a badly bolted on design choice to force tree style data into tabular data.

Instead they should modify SQL to process tree style data as tree style data.

Re:What I Learned from Making the Python Back End for My New... by eigenvalue on Friday October 18, 2024 @04:22PM (#41883113)
There is a JSON column type in SQLite now, and it's supported by SQLModel/SQLalchemy:

https://www.sqlite.org/json1.html

Re:What I Learned from Making the Python Back End for My New... by bb88 on Friday October 18, 2024 @11:49PM (#41885513)
There's a JSONB column type in postgres for a while now too with the arrow syntax.

I think my point is that the structure of the data in a relational database is tree-like. Yet we can only get tabular data out of the queries.