burrow: github.com/hyperledger/burrow/vent/sqlsol Index | Files

package sqlsol

import "github.com/hyperledger/burrow/vent/sqlsol"

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

Package Files

block_data.go constants.go generate.go projection.go spec_loader.go sqlsol.go

Constants

const (
    BytesToBytes = iota
    BytesToString
    BytesToHex
)

func GenerateSpecFromAbis Uses

func GenerateSpecFromAbis(spec *abi.Spec) ([]*types.EventClass, error)

GenerateSpecFromAbis creates a simple spec which just logs all events

func ValidateJSONSpec Uses

func ValidateJSONSpec(bs []byte) error

type BlockData Uses

type BlockData struct {
    Data types.EventData
}

BlockData contains EventData definition

func NewBlockData Uses

func NewBlockData(height uint64) *BlockData

NewBlockData returns a pointer to an empty BlockData structure

func (*BlockData) AddRow Uses

func (b *BlockData) AddRow(tableName string, row types.EventDataRow)

AddRow appends a row to a specific table name in structure

func (*BlockData) GetRows Uses

func (b *BlockData) GetRows(tableName string) (types.EventDataTable, error)

GetRows gets data rows for a given table name from structure

type BytesMapping Uses

type BytesMapping int

type Projection Uses

type Projection struct {
    Tables types.EventTables
    Spec   types.ProjectionSpec
}

Projection contains EventTable, Event & Abi specifications

func NewProjection Uses

func NewProjection(spec types.ProjectionSpec) (*Projection, error)

Takes 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 NewProjectionFromBytes Uses

func NewProjectionFromBytes(bs []byte) (*Projection, error)

NewProjectionFromBytes creates a Projection from a stream of bytes

func NewProjectionFromFolder Uses

func NewProjectionFromFolder(specFileOrDirs ...string) (*Projection, error)

NewProjectionFromFolder creates a Projection from a folder containing spec files

func SpecLoader Uses

func SpecLoader(specFileOrDirs []string, opts SpecOpt) (*Projection, error)

SpecLoader loads spec files and parses them

func (*Projection) GetColumn Uses

func (p *Projection) GetColumn(tableName, columnName string) (*types.SQLTableColumn, error)

Get the column for a particular table and column name

type SpecOpt Uses

type SpecOpt uint64
const (
    Block SpecOpt = 1 << iota
    Tx
)
const (
    None    SpecOpt = 0
    BlockTx         = Block | Tx
)

func (SpecOpt) Enabled Uses

func (so SpecOpt) Enabled(opt SpecOpt) bool

Package sqlsol imports 14 packages (graph) and is imported by 6 packages. Updated 2020-08-30. Refresh now. Tools for package owners.