-
Notifications
You must be signed in to change notification settings - Fork 88
Adding attribute-mapping capability in ZAP where 2 attributes can be linked to each other #1314
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
Adding attribute-mapping capability in ZAP where 2 attributes can be linked to each other #1314
Conversation
980a7e0
to
3033d59
Compare
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.
Apart from naming (which I left comment about in the review), my main question is:
The new table is just attribute junction. It doesn't have any links to the session or package or anything.
What deletes the entries in this table? How does the data get wiped out once the packages are unloaded or anything else happens?
Does a cascade delete of a package remove the entries from this table?
I just want to make sure we don't have a table that keeps growing forever...
src-electron/db/zap-schema.sql
Outdated
DROP TABLE IF EXISTS "ATTRIBUTE_MAPPING"; | ||
CREATE TABLE IF NOT EXISTS "ATTRIBUTE_MAPPING" ( | ||
"ATTRIBUTE_MAPPING_ID" integer primary key autoincrement, | ||
"ATTRIBUTE_REF_1" integer, |
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.
This name should end with _REF
because that's our standard. We say: a field that ends with _REF
is a foreign key. Here you have a field that ends with _REF_1
that is foreigh key.
I would call these:
ATTRIBUTE_LEFT_REF, ATTRIBUTE_RIGHT_REF
or ATTRIBUTE_1_REF and ATTRIBUTE_2_REF
But I would end the name with _REF.
src-electron/zcl/zcl-loader.js
Outdated
const queryNotification = require('../db/query-session-notification') | ||
const { protocol } = require('electron') |
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 don't think the "require('electron')" is right here. Probably just some automatic junk, but it might include tons of crap you don't want.
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.
Good catch.
|
…linked to each other - updating zap schema with attribute mapping table - Updating the zcl-loader to load the multi-protocol.json file from the zcl.json file. See loadAttributeMappingForMultiProtocol function - Provide selectAttributeMappingsByPackageIds in query-attribute.js to retrieve attribute mapping info from packageIds given - Update query-loader with the insert query that updates the attribute mapping table - Add helper functions to check if multi-protocol is enabled and get all attribute mapping info from current session - Add tests for attribute mapping and multi-protocol enablement - Renaming of attribute mapping columns and minor cleanup - Updating the schema JIRA: ZAPP-1315
dd99e82
to
b0256d2
Compare
updating zap schema with attribute mapping table
Updating the zcl-loader to load the multi-protocol.json file from the zcl.json file. See loadAttributeMappingForMultiProtocol function
Provide selectAttributeMappingsByPackageIds in query-attribute.js to retrieve attribute mapping info from packageIds given
Update query-loader with the insert query that updates the attribute mapping table
Add helper functions to check if multi-protocol is enabled and get all attribute mapping info from current session
Add tests for attribute mapping and multi-protocol enablement
JRIA: ZAPP-1315