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
Currently An Aliased field definition maps one field to another (incase of name change). However this proposal is for an alias field definition which includes other SQL syntax. So can do more than simply map to another field.
e.g. in the model below hasCondition is defined as a SQL statement
schema: {hasCondition: '!ISNULL(condition)`,
// ... other field definitions
}
We would then be able to use hasCondition in sql columns....
dare.get('team',[...,'hasCondition']);// SELECT ..., !ISNULL(condition) AS 'hasCondition' LIMIT 1
(note: we can do that already with generated functions. However they can only be applied on response values.)
Aliased SQL syntax could also be applied as the filter
dare.getCount('team',{hasCondition: true});// SELECT ... WHERE (!ISNULL(condition)) = true
Granted the SQL might be ugly but powerful as could also be used in the negative (replace true with false in above codeblock)...
note: As with Generated FIelds, this would be limited to query fields and filters (not INSERT or SET key=>values)
The text was updated successfully, but these errors were encountered:
Currently An Aliased field definition maps one field to another (incase of name change). However this proposal is for an alias field definition which includes other SQL syntax. So can do more than simply map to another field.
e.g. in the model below
hasCondition
is defined as a SQL statementWe would then be able to use
hasCondition
in sql columns....(note: we can do that already with generated functions. However they can only be applied on response values.)
Aliased SQL syntax could also be applied as the filter
Granted the SQL might be ugly but powerful as could also be used in the negative (replace true with false in above codeblock)...
note: As with Generated FIelds, this would be limited to query fields and filters (not INSERT or SET key=>values)
The text was updated successfully, but these errors were encountered: