How is your experience with the OutSystems Community?
cordova-db-inspector
Mobile icon

Cordova DB Inspector

Stable version 1.2.0 (Compatible with OutSystems 11)
Uploaded
 on 16 Nov (19 hours ago)
 by 
0.0
 (0 ratings)
cordova-db-inspector

Cordova DB Inspector

Documentation
1.2.0

Install

  1. Install the component from Forge. It brings the CordovaDBInspector library, whose Extensibility Configuration already includes the native plugin (cordova-plugin-db-inspector #v1.2.0).
  2. In your mobile app, open Manage Dependencies, pick CordovaDBInspector and add the client actions you need.
  3. Generate a new native build (MABS) for Android and/or iOS. The plugin does not run in the browser preview or in the OutSystems preview app.

Client actions

  • CheckDbInspectorPlugin (function) → IsAvailable. Call it first and show a message when the plugin isn't in the build.
  • OpenInspector (Database, Title, PresetsJson, all optional) → opens the full-screen read-only inspector. Database is a file name or id to select first; PresetsJson merges team queries (hfps-db-inspector-presets format) into the saved presets.
  • ListDatabases → Databases (List of DbInspectorDatabase: Id, Name, Size, WalSize, ModifiedMs, Encrypted…), with no UI.
  • RunQueries (Database, QueriesJson, MaxRows = 1000) → Results (List of DbInspectorQueryResult), ResultJson, Success, ErrorMessage. Runs queries with no UI and returns JSON.

RunQueries example

QueriesJson:

[{"name":"pending","sql":"SELECT Id, Status FROM OSUSR_ABC_SYNCQUEUE WHERE Status = :s","params":{"s":1}},
 {"name":"tables","sql":"SELECT name FROM sqlite_master WHERE type = 'table'"}]

Each item of Results has Name, Sql, Columns, RowsJson (the rows as a JSON array text, since columns differ per query), RowCount, Truncated, DurationMs and Error. A failing query only fills its own Error; Success is false only when the whole batch can't run (unknown or encrypted database, invalid JSON). Deserialize a query's RowsJson into your own structure with JSONDeserialize, or send ResultJson to your server as is.

Safety and limits

  • Read-only: only SELECT, WITH, VALUES, PRAGMA and EXPLAIN run; connections are opened read-only. Parameters (:name, @name, $name, ?) are bound, never concatenated.
  • Encrypted (SQLCipher) databases are listed but never opened.
  • Everything in local storage becomes visible to whoever holds the device: expose these actions only in support/debug builds or behind a support role.
  • Android 7+ (API 24) and iOS 13+.

Full guide: integration guide. Issues: GitHub.