Documentation ¶
Overview ¶
This package defines our Solidity to SQL relational database mapping layer which aims to describe tables realised as a projection of all EVM Log events emitted by the chain.
Index ¶
- func ValidateJSONEventSpec(bs []byte) error
- type BlockData
- type Projection
- func NewProjectionFromBytes(bs []byte) (*Projection, error)
- func NewProjectionFromEventSpec(eventSpec types.EventSpec) (*Projection, error)
- func NewProjectionFromFolder(specFileOrDirs ...string) (*Projection, error)
- func SpecLoader(specFileOrDirs []string, createBlkTxTables bool) (*Projection, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateJSONEventSpec ¶
Types ¶
type BlockData ¶
BlockData contains EventData definition
func NewBlockData ¶
NewBlockData returns a pointer to an empty BlockData structure
func (*BlockData) AddRow ¶
func (b *BlockData) AddRow(tableName string, row types.EventDataRow)
AddRow appends a row to a specific table name in structure
func (*BlockData) GetRows ¶
func (b *BlockData) GetRows(tableName string) (types.EventDataTable, error)
GetRows gets data rows for a given table name from structure
func (*BlockData) PendingRows ¶
PendingRows returns true if the given block has at least one pending row to upsert
type Projection ¶
type Projection struct { Tables types.EventTables EventSpec types.EventSpec }
Projection contains EventTable, Event & Abi specifications
func NewProjectionFromBytes ¶
func NewProjectionFromBytes(bs []byte) (*Projection, error)
NewProjectionFromBytes creates a Projection from a stream of bytes
func NewProjectionFromEventSpec ¶
func NewProjectionFromEventSpec(eventSpec types.EventSpec) (*Projection, error)
NewProjectionFromEventSpec receives a sqlsol event specification and returns a pointer to a filled projection structure that contains event types mapped to SQL column types and Event tables structures with table and columns info
func NewProjectionFromFolder ¶
func NewProjectionFromFolder(specFileOrDirs ...string) (*Projection, error)
NewProjectionFromFolder creates a Projection from a folder containing spec files
func SpecLoader ¶
func SpecLoader(specFileOrDirs []string, createBlkTxTables bool) (*Projection, error)
SpecLoader loads spec files and parses them
func (*Projection) GetColumn ¶
func (p *Projection) GetColumn(tableName, columnName string) (*types.SQLTableColumn, error)
Get the column for a particular table and column name