News for hackers. Stuff that matters.
Re:SQL: One of the Most Valuable Skills by dan_hawkins on Wednesday April 27, 2022 @09:37AM (#31179709)
Pretty much no one is doing string appending to build SQL statements for a long time now. You use positional parameters [0] which also addresses problem of SQL injection attacks.

[0] https://www.postgresql.org/docs/current/sql-expressions.html...

Re:SQL: One of the Most Valuable Skills by setr on Wednesday April 27, 2022 @11:49AM (#31181512)
That’s what I meant by parameterized queries.

But composing strings together to forge a SQL query (outside the inputs) is generally a terrible, no-good, awful job. E.G. optionally adding filters to a query.

Largely because the SQL language itself does not compose well, due to its general inconsistency in just about every expression, and it’s awkward/unnecessary strictness in things as simple as SELECT/FROM/WHERE order and evaluation order