rom-sql icon indicating copy to clipboard operation
rom-sql copied to clipboard

Feedback on ROM - Queries

Open janko opened this issue 8 years ago • 4 comments

First of all, the documentation for ROM is excellent! 👏 (both RDocs and guides)

The Projecting function results section inside the "SQL - Queries" guide shows adding function calls to the SQL query using this syntax:

int::count(...)
string::concat(...)

However, I couldn't find any clarification on this neither here nor in the rom-sql RDocs. I know that that this syntax is used for the SQL builder to know when you're adding a function call and when a column identifier (as both are method calls). But it would be great to have an explanation somewhere what are the typed int:: and string:: "namespaces" for, as I'm wondering why isn't there just a single function:: "namespace" 😃

janko avatar Dec 03 '17 22:12 janko

Right, this should be documented. The reason why we require return type, is because we're inferring structs automatically, and we want to know both attribute names and their types.

solnic avatar Dec 04 '17 11:12 solnic

One more thing, we have Any type, so it is possible to add a generic function builder that doesn't require return type, like the function:: syntax you proposed. WDYT @flash-gordon?

solnic avatar Dec 07 '17 11:12 solnic

@solnic sounds like a nice idea. I think we could have fun for brevity.

flash-gordon avatar Dec 07 '17 21:12 flash-gordon

👉🏻 https://github.com/rom-rb/rom-sql/issues/270 👈🏻

solnic avatar Dec 08 '17 10:12 solnic