Live data from Hacker News

Scuttle – SQL and Arel Editor

scuttle.io

11–16 of 16 posts

Re: Scuttle – SQL and Arel Editor

#11
post #3

I'm probably totally old-fashioned and crazy, but I personally think the SQL code is much more readable and understandable than the arel code that's generated. Why does everybody hate SQL so much that they have to invent their own query language which will eventually evolve to have the same capabilities as SQL but which will look differently, and will be specific to a host language? Sure. There's the issue of SQL inj…

Working with strings as code causes editors to get confused, is hard to compose, and means you lose out on any kind of static analysis.

Re: Scuttle – SQL and Arel Editor

#12

Hi all. Arel committer here. This is a very cool application, and I really enjoyed attending (and helping answer questions) at Cameron's RailsConf talk. That being said, I've become increasingly convinced that constructing queries with Arel is a fun exercise, but ultimately not terribly worthwhile for those of us who are just writing applications. There are three reasons I can think of that people write their queries…

4: Generating queries that are composable with other queries.

Re: Scuttle – SQL and Arel Editor

#14
post #12

Hi all. Arel committer here. This is a very cool application, and I really enjoyed attending (and helping answer questions) at Cameron's RailsConf talk. That being said, I've become increasingly convinced that constructing queries with Arel is a fun exercise, but ultimately not terribly worthwhile for those of us who are just writing applications. There are three reasons I can think of that people write their queries…

4: Generating queries that are composable with other queries.

If you really must have this, you can get it already with Relation#merge. If you're just referring to using one query as a subquery in another, this is available in ActiveRecord directly without needing to drop to Arel. In fact, unless you're meaning something very different than what I am interpreting, there's nothing Arel's buying you over ActiveRecord::Relation in this regard.

Re: Scuttle – SQL and Arel Editor

#15
post #9
post #8

Earlier quoted context omitted.

Is there any way to use the OR clause in a Rails SQL query without dropping down to Arel? Can't seem to find a way.

Programatically, I mean. For instance, I can call `where` multiple times in a loop to chain AND clauses.

Not chainably, out of the box, though you can abuse build_where to do this and join with strings easily enough.

Re: Scuttle – SQL and Arel Editor

#16
post #5

(Not the best name maybe, there's a long established OSS project named Scuttle already)

I think you're referring to the Delicious-style "web bookmarks manager" clone -- it has forks like SemanticScuttle as well, I agree, the name is taken. Came here to say this.
Post reply on HN