Extension: TinyDBX extended. Working with several TinyDBs

Hi friends,

this extension is a TinyDB extended. You can work with several independent TinyDB.

  • We have three TinyDB: TinyDB1 (numbers), TinyDB2 (capitals) and TinyDB3 (animals).
  • When you save a Tag/Value, it is always stored in the same file: TinyDB1.xml, without distinction what TinyDB you have used.

If you Clear TinyDB2, for example, Clear all TinyDBs.


With this extension a Tag/Value is stored in file TinyDB2.xml, but a Pretag is added to its Tag depending on the TinyDB that has saved the data.

When App Inventor programmer put a TinyDBX, must set a Pretag Property to distinguish a TinyDBX from another. Pretag is a simple string.

As we saw in this other extension, you can also view data saved in TinyDBX or upload it from a file.

https://groups.google.com/forum/#!category-topic/mitappinventortest/apps-tips--tricks/deCNeNr-X24

  • This is just a didactic extension, use it under your responsibility, I am not responsible for the loss of data.

Regards.

KIO4.COM
com.KIO4_TinyDBX.aix (15.9 KB)
estudiotinydbX.aia (18.7 KB)

2 Likes

Your description is already very detailed, but what are the advantages of your extension?

in teoria quello di poter gestire più dati, però è possibile già farlo usando i blocchi

1.- With only this extention you can work with differents TinyDB, you can use block of App inventor but need many blocks.

2.- With only 1 block (Show) can show independent TinyDB. If you use normal blocks you need many blocks.

3.- When an app inventor programmer load date in TinyDB and then build, if you install that app, TinyDB is empty. With this extention you can load data from asset to TinyDBX when initialize screen.

4.- You can backup very easy TinyDBX in file in SdCard.

5.- You can edit a file in SdCard and load very easy in TinyDBX.

More info…

https://groups.google.com/forum/#!category-topic/mitappinventortest/apps-tips–tricks/deCNeNr-X24

1 Like

un suggerimento: aggiungi questi blocchi all’estensione così sarà più facile lavorare con vari tinydb nell’app

Esos bloques no son necesarios.
En el momento que establece el Pretag en las Propiedades, el cĂłdigo distingue entre las distintas TinyDBX.

Sim é muito útil sim, já tive casos de precisar ter TinyDBs independentes para eliminar alguns dados e manter outro, muito interessante, parabéns.

Obrigado @Heldemir_Lima.

1 Like

With this extension, should all of your tinydb’s be the tinydbx or should you also have one normal tinydb as well?

With this extension, you can use normal TinyDB and TinyDBX.

Thank you! This extension saved my app!

If i use the TinyDb clear all block, will that delete the entire save area including the TinyDBX info or will those still remain?

TinyDB is file: TinyDB1.xml
TinyDBX is file: TinyDB2.xml

They are independent files, if you delete one, it does not affect the other.

Look first post:

1 Like

Hello @Juan_Antonio can you showme how to make a backup of this DB to a text file and restore it afterwars? I currently hace 3 diferent DB and i create 3 txt files useng de File component, but when i try to restore them it simply gets erased

Hello @wlb01

when you edit files to TinyDB, use free Notepad++, and use Codification UTF-8 without BOM.

Here examples:

https://groups.google.com/forum/#!category-topic/mitappinventortest/app-inventor-extensions/7-zmkoNA47E

https://groups.google.com/forum/#!category-topic/mitappinventortest/app-inventor-extensions/7n0CPHIfZSc

1 Like