In-memory database for storing data.
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
None
Action:Insert CSV data
Property Eval mode
No
: string
Action:Define type
: define a column to be number type (Sample capx)Yes
: parse value by eval function of javascrpt
10
'hi'
Math.random()
For example,
AخAName,HP,MP
'aaa',100,20
'bbb',80,30
will insert 2 rows.
Error message will display on console when eval failed.
Action:Insert JSON data
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.
Index keys
, or Action:Set index keys
. ,
, for example xxxxxxxxxx
UID,VarName
Other keys
Action:Set value
if greater
, if less
Action:Set boolean value
Action:Set JSON
Action:Add to
Action:Save
Expression:LastSavedRowID
Pick row by rowID
Else
Pick row by index keys
Update or append key of queried rows
Action:Update value
Action:Update boolean value
Action:Remove by row ID
Action:Remove all
Action:Remove queried rows
, sample capxAction:Remove by row index
Expression:AllRowsAsJSON
, all rows in JSON stringExpression:AllRowsCount
Expression:At
, pick row by index key, then get value
Expression:At( valueOfIndexKey0, valueOfIndexKey1, .... , dataKey )
pick row by (indexKey0 == valueOfIndexKey0
) and (indexKey1 == valueOfIndexKey1
)
Index keys
, or Action:Set index keys
. get value at dataKey
Expression:At( valueOfIndexKey0, valueOfIndexKey1, valueOfIndexKey2, .... , dataKey, defaultValue )
, returns defaultValue
if row or dataKey is not found.
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".
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
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
sort
Action:3. order
, or Condition:3. order
Expression:QueriedRowsAsJSON
, all queried rows in JSON stringExpression:QueriedRowsCount
Expression:QueriedSum( key )
Expression:QueriedMin( key )
Expression:QueriedMax( key )
Condition:For each row
Expression:CurRowContent
Expression:CurRowContent
, returns key-value pairs of current row in JSON stringExpression:CurRowContent( key )
, returns the value of a specific key, or 0 if the key does not existExpression:CurRowContent( key, defaultValue )
, returns the value of a specific key, or defaultValue
if the key does not exist.Expression:CurRowIndex
Get queried row by index from 0 to Expression:QueriedRowsCount
-1 (sample capx)
Expression:Index2QueriedRowContent( index )
, returns key-value pairs of the specific row in JSON string
Expression:Index2QueriedRowContent( index, key )
, returns the value of a specific key, or 0 if the key does not exist
Expression:Index2QueriedRowID( index )
, returns rowID of the specific rowExpression:Index2QueriedRowContent( index, key, defaultValue )
, returns the value of a specific key, or defaultValue
if the key does not exist.
Sample capx Queried rows will be changed after database updated.
Property Database name
Empty string ""
: private database, destroyed when instance had been destroyed
Not empty string : a global database indexed by this Database name
property
It supports official saving & loading feature, queried result will also be saved.
All rows will be shown at debug panel in JSON format.