logoalt Hacker News

munro • today at 2:51 PM • 3 replies • view on HN

IDK lot of noise in report, I need more signal to noise ratio, already reading so much AI output as it is.

But the example PR... It said code generate with Claude, is it really still this bad? Last I was using SQLAlchemy with Claude was Opus 4.5, and it took some heavy coaching and skill gen not to generate code like this--but why even use SQLAlchemy at all if you're just going to use string interpolation jeez

https://github.com/erich-oliveira-winnin/full-stack-fastapi-...

    owner = "" if current_user.is_superuser else f"WHERE owner_id = '{current_user.id}'"
    query = f"SELECT status, count(*) FROM item {owner} GROUP BY status"
    rows = session.execute(text(query)).all()
Part of me thinks maybe because it's not popular or well documented, but SQLAlchemy has an eDSL of SQL, so you can skip the whole ORM/table mapping layer, and just use it to programmatically construct SQL syntax

Replies

alex_suzuki • today at 3:23 PM

> SQLAlchemy has an eDSL of SQL, so you can skip the whole ORM/table mapping layer, and just use it to programmatically construct SQL syntax

Yes, this is called SQLAlchemy Core: http://docs.sqlalchemy.org/en/latest/core/

You can also just use psycopg (the Postgres driver layer) directly, it’s surprisingly ergonomic in my (limited) experience.

nico • today at 3:52 PM

> It said code generate with Claude, is it really still this bad?

Anecdata, datapoint of 1 personal experience: I had been using Opus 4.6 with no problems until yesterday, then it seemed like it was missing things constantly, introducing random bugs, forgetting basic stuff that was in its memory and skills and should never miss

Same thing happened on 2 separate sessions I had with Opus 4.6

Ended up switching to 5.5 and Fable, things improved instantly

This left me with a weird taste

➕ show 1 reply
benglish11 • today at 2:57 PM

That’s my favorite part of sqlalchemy. I don’t even use the orm anymore.