[FREE] πŸ—„οΈBigDB - Advanced key-value storage with TTL, metadata, multi-table support, encryption, and more

BigDB

[FREE] :free_button: :file_cabinet: BigDB

Advanced key-value storage with TTL, metadata, multi-table support, encryption and more.

Open store


:clipboard: Extension specifications

Package in.sarthakdev.bigdb
Version 2.0
Price Free
Category Data
Updated 18 September 2026
Platforms MIT App Inventor, Kodular, Niotron, Android Builder, Thunkable
Built using FAST
Store BigDB Extension - Data Extension for MIT App Inventor, Kodular, Niotron | SarthakDev.in

:open_book: About

Local SQLite-backed key-value store with tables, TTL, metadata, encryption, and async reads. Use a queryId on Get so the matching Got event is easy to bind.

:sparkles: Features

  • Multiple table support
  • Time-to-live (TTL) for automatic data expiration
  • Metadata and tagging system
  • Built-in encryption for sensitive data
  • Advanced query and filtering
  • Batch operations
  • Export and import functionality
  • Better performance than TinyDB

:bell: Events

Got

Fires when a value is retrieved

Got

  • queryId (text) β†’ Id you pass so the matching event can be told apart.
  • value (text)

Key List

Fires when a key list is returned

KeyList

  • queryId (text) β†’ Id you pass so the matching event can be told apart.
  • keys (any)

Data Changed

Fires when data changes in the current table

DataChanged

Error Occurred

Fires when an error occurs

ErrorOccurred

  • message (text)

Random Key Retrieved

Fires when a random key is retrieved

RandomKeyRetrieved

  • queryId (text) β†’ Id you pass so the matching event can be told apart.
  • key (text)

Expired Keys Retrieved

Fires when expired keys are retrieved

ExpiredKeysRetrieved

  • queryId (text) β†’ Id you pass so the matching event can be told apart.
  • keys (any)

Table Size Retrieved

Fires when the table size is retrieved

TableSizeRetrieved

  • queryId (text) β†’ Id you pass so the matching event can be told apart.
  • size (number)

:wrench: Methods

Enable Auto Cleanup

Enable or disable auto-cleanup of expired records at the specified interval (in seconds). Set interval to 0 to disable.

EnableAutoCleanup

  • intervalSeconds (number)

Purge Expired

Purge expired keys from the current table

PurgeExpired

Set Password

Set database encryption password (PRAGMA key)

SetPassword

  • pwd (text)

Remove Password

Remove encryption (PRAGMA rekey to empty)

RemovePassword

Is Encrypted

Check if database is encrypted

IsEncrypted

Returns boolean.

Store

Store a value for a key with optional TTL and metadata

Store

  • key (text)
  • value (text)
  • useTTL (boolean)
  • ttlSeconds (number)
  • metadata (text)

Get

Get the value for a key asynchronously

Get

  • key (text)
  • queryId (text) β†’ Id you pass so the matching event can be told apart.

Delete

Delete a key

Delete

  • key (text)

Clear

Clear all data in the current table

Clear

Rename Key

Rename a key

RenameKey

  • oldKey (text)
  • newKey (text)

Bulk Store

Store multiple key-value pairs

BulkStore

  • keys (list)
  • values (list)

Bulk Delete

Delete multiple keys

BulkDelete

  • keys (list)

Keys

List all keys in the current table asynchronously

Keys

  • queryId (text) β†’ Id you pass so the matching event can be told apart.

Exists

Check if a key exists

Exists

Returns boolean.

  • key (text)

Get Record

Get full record as JSON asynchronously

GetRecord

  • key (text)
  • queryId (text) β†’ Id you pass so the matching event can be told apart.

Find By Metadata

Find keys by metadata substring asynchronously

FindByMetadata

  • query (text)
  • queryId (text) β†’ Id you pass so the matching event can be told apart.

Expire

Set expiry time in seconds for a key

Expire

  • key (text)
  • seconds (number)

Set Metadata

Set metadata for a key

SetMetadata

  • key (text)
  • metadata (text)

Get Metadata

Get metadata for a key

GetMetadata

Returns text.

  • key (text)

Get TTL

Get remaining TTL in seconds for a key (0 if none or expired)

GetTTL

Returns number.

  • key (text)

Get Random Key

Get a random key from the current table asynchronously

GetRandomKey

  • queryId (text) β†’ Id you pass so the matching event can be told apart.

Get Expired Keys

Get all expired keys from the current table asynchronously

GetExpiredKeys

  • queryId (text) β†’ Id you pass so the matching event can be told apart.

Set Bulk Expiry

Set the same TTL for multiple keys

SetBulkExpiry

  • keys (list)
  • seconds (number)

Copy Table

Copy the current table to a new table

CopyTable

  • targetTable (text)

Merge Tables

Merge records from source table into current table

MergeTables

  • sourceTable (text)
  • conflictStrategy (text)

Get Table Size

Get an estimated size of the current table asynchronously

GetTableSize

  • queryId (text) β†’ Id you pass so the matching event can be told apart.

Rename Table

Rename the current table

RenameTable

  • newName (text)

Delete Table

Delete a table

DeleteTable

  • tableName (text)

Check Table Exists

Check if a table exists

CheckTableExists

Returns boolean.

  • tableName (text)

Delete Database

Delete all tables in the database

DeleteDatabase

Export CSV

Export current table as CSV to the specified file path. If filePath is empty, uses the app's external files directory.

ExportCSV

  • filePath (text) β†’ Absolute path to the file on the device.

Import CSV

Import data into current table from CSV

ImportCSV

  • filename (text)

Export JSON

Export current table as JSON string

ExportJSON

Returns text.

Import JSON

Import data into current table from JSON

ImportJSON

  • json (text)

Count

Get total record count in current table

Count

Returns number.

DBSize

Get database file size in bytes

DBSize

Returns number.

List Tables

List all tables in database

ListTables

Returns any.

Watch

Watch changes to a key in the current table

Watch

  • key (text)
  • queryId (text) β†’ Id you pass so the matching event can be told apart.

Unwatch

Stop watching changes to a key

Unwatch

  • key (text)
  • queryId (text) β†’ Id you pass so the matching event can be told apart.

:puzzle_piece: More blocks

SetTable_Set_Property

jkwdjdhal


:shopping_cart: Get the AIX

Download the AIX from the store, then import from Projects β†’ Import extension.


Built by Sarthak Gupta Β· hi@sarthakdev.in Β· sarthakdev.in

11 Likes

is this database locally or online?
if locally, why we need to watch the data change event? isn't it changed by yourself?

2 Likes

This database works locally. The 'Data Changed' event is returned whenever Data is changed in the table. The data although changed automatically, the event comes really handy for showing notifiers etc.
The purpose of the extension is to address the limitations of TinyDB combined with the features of SQLite in native android development.

Bulk Store, Bulk Delete, Watching for changes to a key, TTL, Metadata, Encryption, Renaming Keys, Data Export / Import as Json, csv and endless utilities like DBSize, Clear are offered by BigDB

why the data will change automatically?

1 Like

I was referring to the use of a block like BulkStore or BulkDelete. These blocks will change the database and then the DataChanged event will be returned.

Maybe to enforce relational integrity after the fact?

1 Like

BigDB has many features including indexing the database.

Just clarifying, @Kevinkun asked about the Data Changed event and what was its need. I was trying to say that Data is changed as soon as an operation is used like Bulk store and the event is returned indicating the operation to be successful.

6 likes so far! The extension is getting lots of love.
Thanks everyone!

Any features you want to see in the next version.
Drop them below!

How can I set the ttlseconds to infinite?

1 Like

Blind guess... Set useTTL to false?
(Trying to figure out how to set my own TTL)

1 Like

Because TTL offers security, can I have it active and have infinite time?

1 Like

How to set the value of TTL for a key to infinite?

There are 3 possible methods.

  1. Set useTTL to false.
  2. Set useTTL to true and set the TTL to a very large num
  1. Using the Expire Key method with a value less than or equal to 0.
    First create a key following the second method then, use the Expire block with the key name and set the value of seconds to any -ve value or 0.

Extensions, Tutorials and Resources from Sarthak Gupta

.

1 Like

Okay then, but I wasn't sure if it was possible to have TTL and infinite time at the same time. Thanks!

1 Like

It's possible with method 3 using the expire key block. Welcome

1 Like

:rocket: BigDB v1.1 is here!

:package: Version: 1.1
:date: Release Date: Thursday, June 12, 2025
:alarm_clock: Time: 2025-06-12T16:27:00Z


:compass: Overview

This release supercharges BigDB with powerful new features designed to enhance its already robust key-value storage capabilitiesβ€”TTL, metadata, multi-table support, encryption, export/import, and now:

  • :white_check_mark: Automatic Cleanup of Expired Records
  • :toolbox: Advanced Table & Key Utilities
  • :bar_chart: Better Monitoring & Maintenance Tools

These updates make BigDB more versatile, efficient, and developer-friendly, perfect for App Inventor projects of all types!


:sparkles: New Features

:counterclockwise_arrows_button: Auto-Cleanup of Expired Records

:new_button: Block: EnableAutoCleanup(int intervalSeconds)

:receipt: Description:
Automatically purges expired records at a specified interval using their TTL values.

:hammer_and_wrench: How It Works:

  • EnableAutoCleanup(300) β†’ Clean every 5 minutes
  • EnableAutoCleanup(0) β†’ Disable cleanup
  • :brain: Settings persist via SharedPreferences
  • :repeat_button: Internally uses a Handler to schedule PurgeExpired

:bullseye: Use Case:
Auto-manage temp data like session tokens or cached results.

:gear: Event Triggered: DataChanged after every cleanup

:puzzle_piece: How This Works:
  • A new DataFormat enum with dropdown support (json or csv) was introduced.
  • CSV generation and parsing is handled by helper functions (generateCSV, importFromCSVString).
  • Reuses logic from previous import/export blocks for compatibility and reliability.

:toolbox: New Utility Methods

:key: GetRandomKey(String queryId)

β†’ Returns: Random non-expired key
β†’ Event: RandomKeyRetrieved(queryId, key)
:video_game: Use Case: Random selection for quizzes/games


:hourglass_not_done: GetExpiredKeys(String queryId)

β†’ Returns: Array of expired keys
β†’ Event: ExpiredKeysRetrieved(queryId, keys[])
:broom: Use Case: Auditing stale records for cleanup


:tear_off_calendar: SetBulkExpiry(YailList keys, int seconds)

β†’ Sets TTL for multiple keys at once
β†’ Event: DataChanged
:counterclockwise_arrows_button: Uses transactions for atomicity
:bullseye: Use Case: Managing sessions or temporary keys in bulk


:clipboard: CopyTable(String targetTable)

β†’ Copies current table to a new one
β†’ Fails if table already exists
β†’ Event: DataChanged
:package: Use Case: Backup/archive before data edits


:link: MergeTables(String sourceTable, String conflictStrategy)

β†’ Merges one table into another
β†’ Event: DataChanged
:control_knobs: Strategy:

  • "overwrite": Replace existing keys
  • "ignore": Skip if key exists
    :dna: Use Case: Merging user data from different sources

:straight_ruler: GetTableSize(String queryId)

β†’ Estimates table size (bytes)
β†’ Event: TableSizeRetrieved(queryId, size)
:bar_chart: Use Case: Alert users of large table size


:pencil: RenameTable(String newName)

β†’ Renames current table
β†’ Fails if name exists
β†’ Event: DataChanged
:file_folder: Use Case: Reorganizing tables during app updates


:wastebasket: DeleteTable(String tableName)

β†’ Deletes specified table
β†’ Switches to data_table if current is deleted
β†’ Event: DataChanged
:soap: Use Case: Removing obsolete data


:magnifying_glass_tilted_left: CheckTableExists(String tableName)

β†’ Returns: true/false
:white_check_mark: Use Case: Validation before operations


:bomb: DeleteDatabase()

β†’ Deletes all tables, recreates data_table
β†’ Event: DataChanged
:counterclockwise_arrows_button: Use Case: Reset during development/testing


:blue_book: Usage Instructions

:counterclockwise_arrows_button: Auto-Cleanup

  • Enable with EnableAutoCleanup(seconds)
  • Disable with EnableAutoCleanup(0)
  • :repeat_button: Auto-persisted across sessions

:brain: Asynchronous Methods

  • GetRandomKey β†’ RandomKeyRetrieved
  • GetExpiredKeys β†’ ExpiredKeysRetrieved
  • GetTableSize β†’ TableSizeRetrieved

:high_voltage: Synchronous Methods

  • SetBulkExpiry, CopyTable, MergeTables, RenameTable, DeleteTable, CheckTableExists, DeleteDatabase
    β†’ Fire DataChanged on success
    β†’ Fire ErrorOccurred on failure

:hammer_and_wrench: MergeTables Conflict Resolution

  • "overwrite" β†’ Replace keys
  • "ignore" β†’ Keep existing keys

:brick: Table Management

  • DeleteTable and DeleteDatabase ensure default data_table exists afterward

:pushpin: Additional Notes

  • :white_check_mark: No Breaking Changes – All updates are fully backward-compatible
  • :rocket: Performance Optimized – Uses indices and transactions
  • :thread: Asynchronous Handling – Keeps UI responsive via AsyncTask
  • :shield: Robust Error Handling – Clear messages via ErrorOccurred
  • :package: Zero Dependencies – Lightweight and self-contained

Download link is updated at the top.

:folded_hands: Thank You!

Your support drives the growth of BigDB. These new features bring automation, efficiency, and control to your app's data management. I am excited to hear your feedback and keep improving!


Do check out my other extensions here at https://ai2.sarthakdev.in/

1 Like

You should update your first post with the new blocks and information.

1 Like

Done

:loudspeaker:BigDB v1.2 is here!

:compass: Overview

This release supercharges BigDB with powerful new features designed to enhance its already robust key-value storage capabilitiesβ€”TTL, metadata, multi-table support, encryption, export/import, and now:

  • :toolbox: Advanced Table & Key Utilities
  • :bar_chart: Easier Data Maintainance

ExportToString_Get_Method
ExportToFile_Call_Method
ImportFromFile_Call_Method
ImportFromString_Call_Method

New Features

  1. Added new blocks ImportFromFile and ExportToFile with dropdown for file types like json, csv and sqlite db.
  2. Added new blocks ImportFromString and ExportToString with dropdown for file types like json and csv.

Bug Fixes

  1. Manifest file permissions updated
  2. Improved Performance on old devices

Deprecated
Old blocks for Json and csv import/export.

Download the extension directly from Github Releases tab!

:pray: Thank You!

Your support drives the growth of BigDB. These new features bring automation, efficiency, and control to your app's data management. I am excited to hear your feedback and keep improving!


Do check out my other extensions here at https://ai2.sarthakdev.in/

2 Likes

Please follow the naming conventions also for the helper blocks

JSON --> Json

Taifun

2 Likes