ETinyDB: Extra utilities for Tiny DB

ETinyDB as ExtraTinyDB provides some additional utilities for the TinyDB component.
It offers the following features:

  • Export Tiny DB
    This exports the data stored of a particular namespace or all namespace into the destination file.

    ExportTinyDB

    ExportAll

Sample JSON:

[
  {
    "namespace": "TinyDB1",
    "length": 1,
    "preferences": {
      "count": "123"
    }
  }
]

  • Get JSON Data
    Similarly you can also get JSON data directly returned.

    GetJSON

    GetAllJSON


  • Used Namespaces
    Returns a list of all the used namespaces.

    UsedNamespaces


  • Load JSON Data into Tiny DB
    You can also load the JSON data directly from a string or a file into application's Tiny DBs.

    LoadJSON

    LoadFile


  • Listening to data changes in Tiny DB
    Using this extension, you can get notified whenever a tag in the TinyDB changes to a new value.

    ValueChanged

    Screen Shot 2024-01-20 at 20.51.28
    Screen Shot 2024-01-20 at 20.51.57


  • Wipe Data
    You can either clear a particular namespace or all the namespaces present in the application.

    WipeAll

    Wipe



Extension: xyz.kumaraswamy.etinydb.aix (10.7 KB)

Extension is open source under MIT License:


Thanks
Kumaraswamy B G

11 Likes

This is great. This should be in the TinyDB component and not "just" as an extension.

2 Likes

Looks really handy :clap:

image

Possible to add feature to just wipe a specific namespace ?

2 Likes

Done, added.

3 Likes

Wonderful :slight_smile:

2 Likes

What path does one need to set the the destination?

image

(this done in companion, Android 13, I guessed at the ASD...)

Had a look at your gist, and see it needs a full path:

image

2 Likes


still nothing :frowning_face:

You miss a leading slash in your filename text box.

1 Like

:frowning_face: still nothing

Did you look in your ASD folder ?

/storage/emulated/0/Android/data/<packageName>/files

image

I am using Android 13... I don't see " /storage/emulated/0/"

BTW: I am using the PC to more rapidly search the entire phone

You wont see " /storage/emulated/0/" on your pc, it will be just named as Internal storage....

1 Like

Thank you. I scanned the entire phone and cannot find the file

Frustrated after 12 hours just trying to save JSON to file :flushed:

What is the "global Data" here? It needs to be a real valid namespace.
Also, dont do automatic searches, sometimes the file maybe missed....

Global Data is the namespace on TinyDB that I need

No automatic searches .. I search by hand but I search both Internal and SD at once

That is a bad thing to hide the real name in a variable....
Also there arent any default namespaces called "TinyDB", it's probably "TinyDB1". Naming is sensitive.

Try these blocks, they will export the file and directly open a share dialog in the phone:

helphim.aia (12.9 KB)

Make sure to carefully change your namespace accordingly... Naming sensitive

1 Like

DatabaseData

That is not the namespace then, it wil never work that way...
In the designer section (not blocks area):

image

wait
HRdatabase

ahhhhh! thats what namespace means :astonished:

Confusing: I also have a TinyDB1 with namespace TinyDB1

1 Like

Is the intent of your ETinyDB to save and restore the entire database ( namespace). I do not want to restore the entire thing... that would be disastrous!

I need to only restore the one variable "Global Data"