Data types
When you create a BlockDB table, every column declares a logical type. BlockDB validates the data format against the type, maps it to the underlying storage, and returns it as the corresponding Python type in the SDK.Character types (usable as primary key)
Every character type exceptHEXSTRING and TEXT can be used as a table’s primary key.
Character types (not usable as primary key or index)
Numeric types
Time types
Boolean type
Composite types (not indexable)
Type usage constraints
- Primary keys may only use the character types
STRING,HASH,ADDRESS,TOKENID,TXID,BLOCKID,CHAINID,DATASET, andLOGO(that is, every character type exceptHEXSTRINGandTEXT). TEXTdoes not support real-time indexing.HEXSTRINGcannot be a primary key and cannot be indexed.JSON,LIST, andDICTcannot be indexed.- All character types are represented as
strin the SDK. All hex types (HASH,ADDRESS,TOKENID,TXID,BLOCKID,HEXSTRING) are hexadecimal strings at the API boundary; BlockDB validates their length and format and stores them as fixed-length or variable-length bytes.
Related topics
- Block State Table and Block Event Table (scenarios for the blockchain-specific logical types)
- API overview