-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP remove service install #1871
base: master
Are you sure you want to change the base?
Conversation
558dfa4
to
2813558
Compare
src/translations/v7/v7.ts
Outdated
[ | ||
'From', | ||
[ | ||
'Alias', | ||
// TODO: should this be changed from table to resource? How? | ||
['Table', 'device service environment variable'], | ||
'dsev', | ||
], | ||
], | ||
[ | ||
'Join', | ||
[ | ||
'Alias', | ||
// TODO: should this be changed from table to resource? How? | ||
['Table', 'service install'], | ||
'si', | ||
], | ||
[ | ||
'On', | ||
[ | ||
'And', | ||
[ | ||
'Equals', | ||
['ReferencedField', 'dsev', 'device'], | ||
['ReferencedField', 'si', 'device'], | ||
], | ||
[ | ||
'Equals', | ||
['ReferencedField', 'dsev', 'service'], | ||
['ReferencedField', 'si', 'installs-service'], | ||
], | ||
], | ||
], | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is joining all desv & service installs, on every dsev row.
You should be able to reference the dsev resource that's on the current context of this query w/ something like:
[ | |
'From', | |
[ | |
'Alias', | |
// TODO: should this be changed from table to resource? How? | |
['Table', 'device service environment variable'], | |
'dsev', | |
], | |
], | |
[ | |
'Join', | |
[ | |
'Alias', | |
// TODO: should this be changed from table to resource? How? | |
['Table', 'service install'], | |
'si', | |
], | |
[ | |
'On', | |
[ | |
'And', | |
[ | |
'Equals', | |
['ReferencedField', 'dsev', 'device'], | |
['ReferencedField', 'si', 'device'], | |
], | |
[ | |
'Equals', | |
['ReferencedField', 'dsev', 'service'], | |
['ReferencedField', 'si', 'installs-service'], | |
], | |
], | |
], | |
], | |
[ | |
'From', | |
[ | |
'Alias', | |
// TODO: should this be changed from table to resource? How? | |
['Table', 'service install'], | |
'si', | |
], | |
], | |
[ | |
'Where', | |
[ | |
'And', | |
[ | |
'Equals', | |
// If you generate the v7 abstract sql model you should be able to find exactly what's the correct name to use in v7 | |
// this references the resource of the current context - ie where this abstract sql is going to be injected. | |
['ReferencedField', 'device-installs-application-has-service name-has-name'', 'device'], | |
['ReferencedField', 'si', 'device'], | |
], | |
[ | |
'Equals', | |
['ReferencedField', 'device-installs-application-has-service name-has-name'', 'service'], | |
['ReferencedField', 'si', 'installs-service'], | |
], | |
], | |
], |
Eg:
open-balena-api/src/translations/v6/v6.ts
Line 174 in 24cca17
['ReferencedField', 'device', 'id'], |
fd6493a
to
1aed2a5
Compare
Change-type: patch
…ce install Change-type: patch
You should probably also rename the commit to something like: |
This is just a test branch where I am accumulating changes. I will PR each possibly independent change in its standalone PRs |
1aed2a5
to
b47a013
Compare
8619c2c
to
d2f9fce
Compare
Change-type: patch
d2f9fce
to
3352b46
Compare
No description provided.