Niotron Guide · June 13, 2021 0

xTinyDB – How to use in Niotorn

Before we jump into the integration and use case of extension in niotron builder. If you haven’t set up your own database, then visit my GitHub repo and set it up first.

In the xTinyDB extension, we have five method and event blocks. and 6 property blocks to set and get a property value. Click here to view all available blocks with input and return type.

Now as everything is all set, let’s start with,

Store Value

Use this block to store new tags and also update older tags with new values. using this, one or more tags can be stored/updated in a bucket at a time. Below there is three use case. At first, It stores single values associated with the tag. Second, It stores similar value values associated with more than tags. And third, It stores multiple values associated with the tag.

xTinyDB extension niotron builder screenshot 1

After calling these blocks it fires an event based on the server response. On Success, Value Stored. On Failed Error occurred. To process further actions based on response.

xTinyDB extension niotron builder screenshot 2 Event

Get Value

Use this block to get the value of one or more tags at a time. Here is another option to set a default value for a tag, if it’s not available.

xTinyDB extension niotron builder screenshot 3

After calling these blocks it fires an event based on the server response. On success, it triggers Got Value event. which returns the list of tags and values in the same order.

print value using list indexing or getting the index of tag in tags list.

xTinyDB extension niotron builder screenshot 10 Extra edits

Get Bucket

Use this block to get a list of all tags, values, and sub-buckets of the given bucket. On success, it triggers Got bucket.

xTinyDB extension niotron builder screenshot 6

Clear Tag

Use this block to remove/clear/delete the tag from given bucket.

xTinyDB extension niotron builder screenshot 7

After calling these blocks it fires an event based on the server response. On success, it triggers Cleared event block.

xTinyDB extension niotron builder screenshot 8

Clear Bucket

Use this block to remove/clear/delete a bucket from the database. It’ll delete all values associated with the tags and sub buckets too. After calling these blocks it fires an event based on the server response. On success, it triggers Cleared event block.

xTinyDB extension niotron builder screenshot 9

Properties

Use this blocks to get/set properties like, projectBucket, ServiceURL, and AccessToken.

xTinyDB extension niotron builder screenshot 10 properties blocks
  • ProjectBucket is the container where the data is getting stored or being called.
  • ServiceURL is the web address where the database is hosted
  • AccessToken a key to authenticate client requests on the server.