You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's not the only way to specify a from in sql, though.
I would like to update the QueryBuilder to keep track of a from instead of table and remove the setting of table in the initialize.
I believe all that would need to change for existing usage to work is to call .from instead of passing the table name into the initialize in the Queryable here
I would like to add an overloaded from that takes in a QueryBuilder and an alias which would translate to the SQL from (query_builder statement) as ALIAS
Why?
I would like to see Avram have robust layers. You don't need a full model and queryable for this particular sql query? Fine, just use the QueryBuilder for a bit of a nicer experience. And that would be without sacrificing any usability of the higher level constructs.
Ultimately, I would like to be able to experiment with different higher level patterns and need this lower layer to be more flexible.
The text was updated successfully, but these errors were encountered:
A blocker for this change is that update and insert don't use "from" so a table_name makes sense. For my goals, I think there would have to be a way to break up the different types of sql statements. I'll keep looking into it
Overview
Right now the "from" is set by the passed in table name in the initializer
avram/src/avram/query_builder.cr
Lines 18 to 19 in 72ac1d6
That's not the only way to specify a from in sql, though.
I would like to update the QueryBuilder to keep track of a
from
instead oftable
and remove the setting of table in the initialize.I believe all that would need to change for existing usage to work is to call
.from
instead of passing the table name into the initialize in the Queryable hereavram/src/avram/queryable.cr
Line 48 in 72ac1d6
I would like to add an overloaded
from
that takes in a QueryBuilder and an alias which would translate to the SQLfrom (query_builder statement) as ALIAS
Why?
I would like to see Avram have robust layers. You don't need a full model and queryable for this particular sql query? Fine, just use the QueryBuilder for a bit of a nicer experience. And that would be without sacrificing any usability of the higher level constructs.
Ultimately, I would like to be able to experiment with different higher level patterns and need this lower layer to be more flexible.
The text was updated successfully, but these errors were encountered: