Skip to content

Commit

Permalink
extend script demo based on user request
Browse files Browse the repository at this point in the history
  • Loading branch information
ake2l committed May 26, 2024
1 parent 07f1f78 commit 03b4880
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/demo/resources/demo/script/scriptdb.ben.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
return query;
}

// db get entitiy count
function getEntityCount(entity) {
const count = db.countEntities(entity);
print('entity count for ' + entity + ' : ' + count);
}

</execute>

<execute target="db" onError="warn">
Expand Down Expand Up @@ -87,4 +93,8 @@
<attribute name="PLAYLIST_TRACK" source="db" selector="{js:getQuery2(1)}" cyclic="true"/>
</generate>

<echo>Printing entity count using JS and AbstractDatabase countEntities function</echo>
<execute type="js">getEntityCount('playlist');</execute>
<execute type="js">getEntityCount('TRACK');</execute>
<execute type="js">getEntityCount('PLAYLIST_TRACK');</execute>
</setup>

0 comments on commit 03b4880

Please sign in to comment.