Remix.run Logo
illegally 3 months ago

I guess this could be useful in SQL for escaping values, I saw a project on the comments here.

With templates:

  mysql.execute(t"DELETE FROM table WHERE id={id} AND param1={param1}")
Without templates:

  mysql.execute("DELETE FROM table WHERE id=%s AND param1=%s", [id, param1])
So one less argument to pass if we use templates.

But yeah it does seem a bit confusing, and maybe kinda not pythonic? Not sure.

zahlman 3 months ago | parent [-]

SQL templating is one of the explicitly cited motivating use cases.