TableExists(TableName = "contacts")
IsSuccess
Exists
InitDBWithSchema(DbName = "MyAppDB", SchemaJSON = <schema below>)
GetAll
Query
Search
RecordsJSON
RecordJSON
Important: InitDBWithSchema deletes and recreates the database every time it runs. Call it only when the table does not exist yet (step 2), otherwise existing data is lost.
InitDBWithSchema
An array of tables:
[ { "name": "contacts", "keyPath": "Id", "autoIncrement": true, "indexes": [ { "name": "Name" }, { "name": "City" } ] }]
Index options: name (required), keyPath (defaults to name), unique, multiEntry.
name
keyPath
unique
multiEntry
Same shape as one table above, without the name (the name comes from TableName):
TableName
{ "keyPath": "Id", "autoIncrement": true, "indexes": [ { "name": "Total" } ] }
autoIncrement
NewId
NewIdsJSON
Upsert
UpsertBulk
Field
Value
ValuesJSON
["Paris","Rome"]
FiltersJSON
{"City":"London","Name":"Ann"}
[{"field":"City","value":"London"}]
Lower
Upper
Prefix
Keyword
Order
asc
desc
Page
PageSize
ChangesJSON
{"City":"Berlin"}
IdsJSON
[3,7,9]
[ { "type": "add", "record": { "Name": "Ivy" } }, { "type": "put", "record": { "Id": 3, "Name": "Cara" } }, { "type": "delete", "id": 4 }]
Supported types: add, put (also upsert / update), delete, clear. If any operation fails, none are applied.
add
put
upsert
update
delete
clear
Every action returns IsSuccess (Boolean) and ErrorMessage (Text). Always check IsSuccess before using the other outputs. Typical messages: "No database is initialized.", "Table does not exist.", invalid JSON, or "Database upgrade is blocked by another open connection…" (close other tabs and retry).
ErrorMessage