Hey there 🙂
I wondered what’s the rationale behind not matching the common sql-syntax with the
select
clause.
Someone who’s used to sql would expect the dsl to work something like this:
Copy code
val gamailUsers = Users.select(id, name, email)
.where { email like "%@gmail.com"}
.map { ... }
But instead expose uses
slice
to do the projection. And select to do the selection. Why is this? I don’t realy have an opinion, I just want to know what the reason behind this decision was.
t
tapac
02/20/2019, 8:56 PM
It's a historical thing which comes from a very first commits of initial creator of Exposed.
I can create an issue to replace that methods. But now there is
selectAll
function, how do you think it should be renamed?
all
? Any suggestions?
l
lovis
02/21/2019, 8:52 AM
That’s a good question.
Like I said, I don’t really have an opinior, I was just curious 🙂
but imho
selectAll
is nice actually so I don’t know if it should be renamed
t
tapac
02/21/2019, 12:05 PM
Then it will look like
FooTable.select(FooTable.bar).selectAll()
l
lovis
02/21/2019, 12:22 PM
well that’s weird, I give you that. Maybe not change anything for now 😉