Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

A question. #333

Closed
txdv opened this issue Sep 5, 2014 · 3 comments
Closed

A question. #333

txdv opened this issue Sep 5, 2014 · 3 comments

Comments

@txdv
Copy link

txdv commented Sep 5, 2014

I posted this question on stack overflow http://stackoverflow.com/questions/25668941/create-partial-queries-with-squeel

For better visibility I'll just add an issue.

@vendethiel
Copy link

Please don't. Issues are not meant to be stackoverflow - SO is meant to be SO. You can also ask questions in google groups etc, but issues are meant for bug reports, feature requests, etc

@txdv
Copy link
Author

txdv commented Sep 5, 2014

Well let me form this as an issue/feature request, squeel lacks the composability that arel has, as far as I can see, and it would make the library much more useful.

Currently I'm doing 3 queries which I could combine. The additional sql constraints are generated depending on the input of the program.

@bigxiang
Copy link
Contributor

bigxiang commented Sep 8, 2014

@txdv Thank you for the post first, Squeel wants to leverage the power of Arel, but it combines to ActiveRecord tighter. It's hard to say how important we need to get a SQL string of a predicate. In ActiveRecord, to_sql is not as simple as Arel, many things hides to users, for example, generate proper alias for joined tables and their where clauses. In my personal opinion, partial queries are the role of scopes in ActiveRecord or sifts in Squeel. It's not hard to create a reuseable partial query in either way. Don't consider to_sql for partial queries :)

@txdv txdv closed this as completed Oct 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants