Categories > Data structure > rex_taffydb

Introduction

In-memory database for storing data.

Links


Categories > Data structure > rex_taffydbIntroductionLinksDependenceUsageWriteInsert rows by CSVData typeInsert rows by JSONSave rowUpdate rowsRemoveRemove queried rowsReadRead all rowsRead by index keyQueryingBuild filterRead all queried rowsRetrieve queried rowsQueried result after database updatedDatabase referenceSave & loadDebug panel

Dependence

None

Usage

Write

Insert rows by CSV

Sample capx

Action:Insert CSV data

Data type

Property Eval mode

Insert rows by JSON

Sample capx

Action:Insert JSON data

Save row

Save row
2. Save
1. Prepare row
Yes
Found
No
Yes
Found
Not found
No
Update row
Insert new row
Action:Save
Set value
----
Action:Set value
Set row ID
----
Action:Set row ID
Action:Set row index
Set index key
----
Action:Set value
Has
Row Id
Find row
by rowID
Has index key
Find row
by index key

Sample capx

  1. prepare row

    • Save data at a specific row, i.e. pick row then update it

      • Action:Set row ID, or Action:Set row index

      • Action:Set value , to set value of index key (Sample capx)

        • Index keys : a set of keys which the values are unique.

          • Property Index keys, or Action:Set index keys.
          • Multiple keys are separated by ,, for example
           
          xxxxxxxxxx
          UID,VarName
    • Other keys

      • Action:Set value

        • options: if greater , if less
      • Action:Set boolean value

      • Action:Set JSON

      • Action:Add to

  2. Action:Save

    • Expression:LastSavedRowID

    • Pick row by rowID

      • Update row if found
    • Else

      • Pick row by index keys

        • Update row, if found, or
        • Insert new row

Update rows

Sample capx

Update or append key of queried rows

Remove

Remove queried rows

Read

Read all rows

Read by index key

Sample capx

Sample capx2-counter

Expression:At, pick row by index key, then get value

For example, property Index keys is Name,

 
xxxxxxxxxx
DB.At("aaa", "HP")

to get row by Name is "aaa", then returns value of key "HP".

Querying

Query
New filter
----
Condition:1. New
Value comparison
----
Condition:2. value compare
Condition:2. boolean value compare
Condition:2. regex matched
Current filter
Sort
----
Condition:3. order
Queried rows
----
Expression:QueriedRowsAsJSON
Expression:Index2QueriedRowContent(index)
Expression:QueriedRowsCount
Condition:For each row
Expression:CurRowContent
Expression:CurRowIndex

Sample capx

Build filter
  1. Create a new filter, or start from current filter (sample capx), if it does not create a new filter.

    • Action:1. New, orCondition:1. New
  2. Add conditions

    • Action:2. value compare, or Condition:2. value compare
    • Action:2. boolean value compare, or Condition:2. boolean value compare
    • Action:2. regex matched, or Condition:2. regex matched
  3. sort

    • Action:3. order, or Condition:3. order
Read all queried rows
Retrieve queried rows

Condition:For each row

Get queried row by index from 0 to Expression:QueriedRowsCount-1 (sample capx)

Queried result after database updated

Sample capx Queried rows will be changed after database updated.


Database reference

Sample capx

Property Database name


Save & load

It supports official saving & loading feature, queried result will also be saved.


Debug panel

All rows will be shown at debug panel in JSON format.