auraphp / Aura.SqlQuery

Independent query builders for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.
MIT License
452 stars 86 forks source link

move copy/pasted where() / orWhere() to WhereTrait #116

Closed pavarnos closed 7 years ago

pavarnos commented 7 years ago

could do similar for LimitInterface, LimitOffsetInterface and ValuesInterface.

harikt commented 7 years ago

@pavarnos I have a question here.

Do we really need trait or can we just add these methods to AbstractQuery class ?

pavarnos commented 7 years ago

Could do. But where() / orWhere() is not used by Insert so the methods do not make any sense on that class. So then we'd need to have some way to hide them from the public interface of the Insert class? Similarly with limit/offset. ValuesInterface is used by Insert and Update (and potentially by Select) but not by Delete. So there is no obvious hierarchy.

Its just an idea. Delete the PR if you think it is going in the wrong direction.

harikt commented 7 years ago

Sorry I didn't thought more about that :) .

pavarnos commented 7 years ago

could also do similar for ReturningInterface, which is only used by pgsql... but yeah, how far should we go?