BlocosIA Wiki Editor

Local Database

Salve recordes, variáveis de qualquer tipo, objetos de Web e JSON, inventários e tabelas completas no dispositivo (funciona sem internet).

Encaixe variáveis de qualquer tipo (números, textos, listas ou objetos JSON) e blocos de "Web e JSON" diretamente em qualquer entrada do banco local.

To use it: in the editor, click "Extensions" (bottom corner) and add "Local Database".

Stack

use local database ( )

Selects which local database to use (lets you separate data for different modes or profiles).

Reporter

active local database

Gives a number or text. Put it inside a round slot.

Stack

salvar a variável [score] no banco de dados

Does an action. Snap it below another block.

Stack

carregar na variável [score] do banco (se não existir: ( ))

Does an action. Snap it below another block.

Stack

save in database key ( ) value ( )

Saves a value (number, text, list or object) under a key in the device local database.

Reporter

read key ( ) from database

Reads the value saved under a key in the local database.

Reporter

read key ( ) from database (if missing: ( ))

Reads a key from the local database or returns the default value if the key does not exist yet.

Stack

add ( ) to key ( ) in database

Does an action. Snap it below another block.

Boolean

does key ( ) exist in database?

True if the key is already saved in the local database.

Stack

delete key ( ) from database

Does an action. Snap it below another block.

Reporter

list of keys in database

Gives a number or text. Put it inside a round slot.

Reporter

list of values in database

Gives a number or text. Put it inside a round slot.

Reporter

number of keys in database

Gives a number or text. Put it inside a round slot.

Stack

clear entire local database

Clears all keys and tables from the active local database.

Reporter

registro com [name] : ( ) , [score] : ( )

Gives a number or text. Put it inside a round slot.

Reporter

valor do campo ( ) na chave ( ) do banco

Gives a number or text. Put it inside a round slot.

Stack

na chave ( ) do banco mudar o campo ( ) para ( )

Does an action. Snap it below another block.

Stack

insert into table ( ) record ( )

Does an action. Snap it below another block.

Stack

update in table ( ) where id = ( ) field ( ) to ( )

Does an action. Snap it below another block.

Stack

save in table ( ) record with id ( ) value ( )

Does an action. Snap it below another block.

Stack

remove from table ( ) where id = ( )

Does an action. Snap it below another block.

Stack

clear entire table ( )

Does an action. Snap it below another block.

Reporter

record from table ( ) with id = ( )

Gives a number or text. Put it inside a round slot.

Reporter

all records from table ( )

Gives a number or text. Put it inside a round slot.

Reporter

find in table ( ) where ( ) [=] ( )

Gives a number or text. Put it inside a round slot.

Reporter

number of records in table ( )

Gives a number or text. Put it inside a round slot.

Reporter

records from table ( ) sorted by ( ) [ascending (lowest → highest)]

Gives a number or text. Put it inside a round slot.

Reporter

[sum] of field ( ) in table ( )

Gives a number or text. Put it inside a round slot.

Reporter

last inserted id in database

Gives a number or text. Put it inside a round slot.

Reporter

export database as JSON

Gives a number or text. Put it inside a round slot.

Reporter

banco de dados como objeto JSON

Gives a number or text. Put it inside a round slot.

Stack

importar JSON ou objeto ( ) para o banco de dados (modo: [merge with current data])

Does an action. Snap it below another block.

Hat

when data is saved in database

Starts a script when this happens.

Hat

when key ( ) changes in database

Starts a script when this happens.

Reporter

last changed key in database

Gives a number or text. Put it inside a round slot.

Reporter

last saved value in database

Gives a number or text. Put it inside a round slot.