I couldn't find any answer in slick documentation https://books.underscore.io/essential-slick/essential-slick-3.html (perhaps my poor search skills)
My question is, I have the following query construction:
messages.filter(_.sender === "Dave")
But in practice folk does
messages.filter(_.sender === "Dave".bind)
What is the difference and why is it motivated to do so?
I tinkered a little in REPL with slick, and that is all I've got:
scala> messages.filter(_.sender === "Dave").result.statements.toString res7: String = List(select "sender", "content", "id" from "message" where "sender" = 'Dave') scala> messages.filter(_.sender === "Dave".bind).result.statements.toString res8: String = List(select "sender", "content", "id" from "message" where "sender" = ?)
In the first case we got query with static injected value in it, it is in
'' and I think there is no danger of sql injection.
In second scenario we've got just placeholder, in this case when the values are actually will be inserted in query?
why the second case with
Sorry for my terrible english with a lot of syntax error's
@nafg I think we'll be ready to do an RC in about two weeks, and then after that wait a month or so, minimum, before final? maybe longer depending on how the RC is received?
but also, I'm not just trying to get one release out, I'm hoping this can be self-sustaining again going forward, for as long as people are still using the library
What do you want to achieve?
I wanted to implement something like "clean up" actions. Attach an effect to your DBIO, and carry it around with you across all the flatmaps/andthens etc, and then when it is eventually run tack the effects on to the future as a side-effect.
Imagine something like a huge dbio transaction that at some point changes a user's subscription settings. At that point in the DBIO, I know I have to send an email to the user. It would be handy to at that point attach it (the send-email effect) to the DBIO and have it dealt with alongside the transaction execution automatically (if the transaction succeeds)
bit(1)data type for a
min(...)like this example
select min(field1), min(field2), min(myBit1Field) from ... group by id. Unfortunately, that aggregation doesn't play well with mysql's
bit(1)which in my case ends up being
truein my scala object when the record field in DB is 0x00 (false).