[FREE] ⚡ Cloudflare Database Extension v2.0 - Blazing Fast D1 SQLite, Multi-Table, Advanced Query & Concurrency-Safe Updates!

Hello Kodular Builders! :waving_hand:

Tired of slow Google Sheets, complex Firebase rules, or expensive server limits? Today, I am thrilled to introduce Cloudflare Database Extension (v2.0) for App Inventor, Kodular, and Niotron!

This extension directly connects your mobile apps to Cloudflare D1 (Cloudflare’s ultra-fast, serverless, globally distributed SQLite database) via high-performance Cloudflare Workers. Experience lightning-fast query execution, multi-table queries, column-level conditional updates/deletes, and concurrency-safe numeric increments with zero hassle!


:glowing_star: Key Features

  • :high_voltage: Blazing Fast Global Edge Performance: Powered by Cloudflare’s global edge network for sub-millisecond response times worldwide.

  • :file_cabinet: Multi-Table Architecture: Manage multiple tables in a single D1 database. Fetch individual tables or all tables at once ("all").

  • :bullseye: Advanced Column-Based Operations: Update or Delete rows matching specific column values without needing row IDs (e.g., WHERE UserEmail = 'xyz').

  • :package: Multi-Column Bulk Updates: Update multiple columns simultaneously with a simple JSON object.

  • :plus: Atomic Increment / Decrement: Concurrency-safe numeric updates (perfect for wallet balances, coin systems, view counts, and scores).

  • :locked: Enterprise-Grade Security: Authenticated with Bearer API tokens and custom Cloudflare Worker endpoints.

  • :shield: Built-in Device Security Check: One-time silent background activation via your registered Email and Item ID.

  • :free_button: 100% Lifetime Free: Free for personal and commercial applications.


:bar_chart: Extension Specifications

  • :package: Package: com.abid.cloudflaredatabase

  • :gear: Version: 2.0

  • :floppy_disk: Size: 34.42 KB (Ultra-lightweight)

  • :mobile_phone: Minimum API Level: 14+ (Android 4.0+)

  • :test_tube: Companion Friendly: Yes (Auto-verified in live companion testing)


:puzzle_piece: Blocks Overview

AccessDenied

AccessGranted

OnDataDeleted

OnDataFetched

OnDataStored

OnDataUpdated

OnError

OnValueUpdated

DeleteData

FetchData

ForceRecheck

IsAccessGranted

IsSessionVerified

IsVerified

ItemID

ResetSecurityData

StartSecurityCheck

StoreData

ApiSecret

ApiUrl


:open_book: Detailed Blocks & Documentation

:gear: Properties (Designer & Blocks)

| Property | Type | Description |

| :— | :— | :— |

| ApiUrl | Text | The HTTPS endpoint URL of your deployed Cloudflare Worker. |

| ApiSecret | Text | The secret Bearer authorization token used to authenticate requests. |


:rocket: CRUD & Database Methods

  • :inbox_tray: FetchData (tableName, id):

Retrieves data from your D1 database. Pass "all" to fetch all tables at once, or provide a specific tableName. Set id to empty "" to retrieve all rows, or specify an ID for a single record.

  • Triggers: OnDataFetched(response, tableName)

  • :floppy_disk: StoreData (tableName, jsonData):

Inserts a new row into the specified table using a JSON string.

  • Example: {"name":"Ali", "email":"ali@example.com", "balance": 100}

  • Triggers: OnDataStored(response, tableName)

  • :pencil: UpdateData (tableName, id, jsonData):

Updates a record matching the primary ID with the provided JSON payload.

  • Triggers: OnDataUpdated(response, tableName)

  • :wastebasket: DeleteData (tableName, id):

Deletes a record matching the primary ID.

  • Triggers: OnDataDeleted(response, tableName)

:bullseye: Advanced Column-Level Methods

  • :counterclockwise_arrows_button: UpdateByColumn (tableName, whereColumn, whereValue, updateColumn, updateValue):

Updates a specific column where another column matches a value.

  • Example: Set PaymentStatus = "Paid" where TransactionID = "TXN-98765".

  • Triggers: OnDataUpdated(response, tableName)

  • :memo: UpdateMultipleByColumn (tableName, whereColumn, whereValue, jsonUpdates):

Updates multiple columns at once using any unique column value.

  • Example: Where UserEmail = "ali@gmail.com", update Name, Phone, and City by passing {"Name":"Abid Ali", "Phone":"03449490070", "City":"Lahore"}.

  • Triggers: OnDataUpdated(response, tableName)

  • :cross_mark: DeleteByColumn (tableName, whereColumn, whereValue):

Deletes rows where a target column matches a value.

  • Example: Delete from table Cart where UserEmail = "user@test.com".

  • Triggers: OnDataDeleted(response, tableName)

  • :plus: UpdateDataValue (tableName, uniqueColumn, uniqueValue, updateColumn, amount):

Atomically increments or decrements a numeric value in Cloudflare D1 without race conditions. Pass positive numbers (+10) to add, or negative (-5) to subtract.

  • Example: Add 50 coins to Wallet where UserID = "U123".

  • Triggers: OnValueUpdated(response, tableName)


:shield: Security & Free Activation Blocks

| Method / Property | Return Type | Description |

| :— | :— | :— |

| StartSecurityCheck (email, itemId) | None | Silently validates activation in background. Call in Screen.Initialize. |

| ForceRecheck (email, itemId) | None | Clears cache and re-validates credentials with the server. |

| ResetSecurityData () | None | Resets local device verification cache (for developer testing). |

| UserEmail () | Text | Returns the currently verified email address. |

| ItemID () | Text | Returns the registered Item ID. |

| IsVerified () | Boolean | Returns true if device has completed verification. |

| IsAccessGranted () | Boolean | Returns true if activation was approved. |

| IsSessionVerified () | Boolean | Returns true if active session is verified. |


:bell: Events

  • OnDataFetched (response, tableName): Returns fetched data array / JSON.

  • OnDataStored (response, tableName): Triggered after insertion completes.

  • OnDataUpdated (response, tableName): Triggered after standard or column updates.

  • OnDataDeleted (response, tableName): Triggered after row deletion.

  • OnValueUpdated (response, tableName): Triggered when a numeric value is incremented or decremented.

  • OnError (errorMsg): Fires when an error occurs during API execution.

  • AccessGranted (): Fires when free registration verification succeeds. Safely load your app data here!

  • AccessDenied (email, itemId): Fires if verification fails or unverified credentials are used.


:hammer_and_wrench: Quick Start Guide

  1. Deploy Cloudflare Worker: Deploy the worker script connected to your Cloudflare D1 database.

  2. Add Component: Drop CloudflareDatabase into your project and set your ApiUrl and ApiSecret.

  3. Register & Verify: In Screen1.Initialize, call StartSecurityCheck with your registered email and free Item ID.

  4. Handle AccessGranted: Once AccessGranted fires, call FetchData("users", "") and bind your data to ListViews or Dynamic Components!


:inbox_tray: Download & Free Activation

This extension is 100% FREE for everyone. To activate it for lifetime use in your applications, simply register for a free Item ID on our official website.

  1. Download Extension (.aix):

com.abid.cloudflaredatabase.aix (35.7 KB)
(Note)There was a bug in it—specifically regarding a security check—which has now been fixed.

  1. Get Free Lifetime Item ID (Registration):

:backhand_index_pointing_right: Visit Our Official Website to Register Free

(Note: Safe, browser-based instant activation — no third-party APK app required).

  1. Example Project (.aia):

:backhand_index_pointing_right: [Download Sample .aia Project](Coming Soon)


:light_bulb: Support & Feedback

If you encounter any bugs, have questions, or need assistance setting up your Cloudflare Worker, feel free to reply to this thread!

:star: If this extension powers up your apps, don’t forget to Like (:heart:) this thread! Happy Coding! :rocket:

2 Likes

Thank you for your contribution :+1:

Could you please let us know which tool you used to built your extension? Sharing this information would make it possible to provide constructive feedback to the tool’s author for further development and encourage potential new contributors.

Keep up the excellent work :clap:

Thank you so much @JEWEL! :heart:

This extension was built and documented using your incredible tool FAST-CLI (v7.1.1)!

It is truly a game-changer—super fast, makes generating block images and docs effortless, and makes extension development a wonderful experience. Thank you for creating such an amazing tool for the entire community! :rocket::clap:

1 Like