refactoring consistency checks WIP

This commit is contained in:
zadam
2019-02-02 10:38:33 +01:00
parent e58a80fc00
commit 910cfe9a17
2 changed files with 138 additions and 124 deletions

View File

@@ -57,6 +57,11 @@ async function getOption(name) {
return await getEntity("SELECT * FROM options WHERE name = ?", [name]);
}
/** @returns {Link|null} */
async function getLink(linkId) {
return await getEntity("SELECT * FROM links WHERE linkId = ?", [linkId]);
}
async function updateEntity(entity) {
const entityName = entity.constructor.entityName;
const primaryKeyName = entity.constructor.primaryKeyName;
@@ -119,6 +124,7 @@ module.exports = {
getBranch,
getAttribute,
getOption,
getLink,
updateEntity,
setEntityConstructor
};