Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I never use string concat to generate SQL in Go - isn’t it normal to use placeholders? ie,

    db.QueryRow(“select $1”, n)
Looking at squirrel, I really don’t see how this

    sql, args, err := sq.Insert("users").Columns("name", "age").
    Values("moe", 13).Values("larry", sq.Expr("? + 5", 12)).
    ToSql()
Is better than this

    sql == "INSERT INTO users (name,age) VALUES (?,?),(?,? + 5)"
That said, I will happily agree that that SQL statement composition is not the same as an ORM, and I can see the benefit of Squirrel for those rare times you do need to conditionally build SQL statements.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: