3 ms·
I failed to see the value. You don't have to use the modeling part of an ORM. Just the built-in security, session, and connection pool handling is already valu
by rmbyrro 3y ago
I failed to see the value.
You don't have to use the modeling part of an ORM. Just the built-in security, session, and connection pool handling is already valuable. And you can already do:
```
params = [123]
session.query("SELECT * FROM my_table WHERE userID = ?", params)
```
Why introduce another library just for that?
- bastawhiz 3y agoIf you have a lot of values to add to a query, they're physically distant from the place you're using them. With the unnamed version like you used, you're relying on your ability to count how many values are used so you get the list correct. With named parameters, you're adding another layer of indirection. Use a value more than once? If you change it or want to remove it, you'd better be sure you do it for each usage of the name in your query!
- rmbyrro 3y agoAh, that indeed makes sense