sqlstore

package
v1.0.1-beta-3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2023 License: MIT, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnSchema

type ColumnSchema struct {
	Name        string
	Type        string
	Constraints []string
}

ColumnSchema represents the schema of a column.

type Receipt

type Receipt struct {
	ChainID      tableland.ChainID
	BlockNumber  int64
	IndexInBlock int64
	TxnHash      string

	TableID       *tables.TableID
	Error         *string
	ErrorEventIdx *int
}

Receipt represents a Tableland receipt.

type SystemACL

type SystemACL struct {
	Controller string
	ChainID    tableland.ChainID
	TableID    tables.TableID
	Privileges tableland.Privileges
	CreatedAt  time.Time
	UpdatedAt  *time.Time
}

SystemACL represents the system acl table.

type SystemStore

type SystemStore interface {
	GetTable(context.Context, tables.TableID) (Table, error)
	GetTablesByController(context.Context, string) ([]Table, error)

	GetACLOnTableByController(context.Context, tables.TableID, string) (SystemACL, error)

	ListPendingTx(context.Context, common.Address) ([]nonce.PendingTx, error)
	InsertPendingTx(context.Context, common.Address, int64, common.Hash) error
	DeletePendingTxByHash(context.Context, common.Hash) error
	ReplacePendingTxByHash(context.Context, common.Hash, common.Hash) error

	GetReceipt(context.Context, string) (eventprocessor.Receipt, bool, error)

	GetTablesByStructure(context.Context, string) ([]Table, error)
	GetSchemaByTableName(context.Context, string) (TableSchema, error)

	AreEVMEventsPersisted(context.Context, common.Hash) (bool, error)
	SaveEVMEvents(context.Context, []tableland.EVMEvent) error
	GetEVMEvents(context.Context, common.Hash) ([]tableland.EVMEvent, error)
	GetBlocksMissingExtraInfo(context.Context, *int64) ([]int64, error)
	InsertBlockExtraInfo(context.Context, int64, uint64) error
	GetBlockExtraInfo(context.Context, int64) (tableland.EVMBlockInfo, error)

	GetID(context.Context) (string, error)

	Begin(context.Context) (*sql.Tx, error)
	WithTx(tx *sql.Tx) SystemStore
	Close() error
}

SystemStore defines the methods for interacting with system-wide data.

type Table

type Table struct {
	ID         tables.TableID    `json:"id"` // table id
	ChainID    tableland.ChainID `json:"chain_id"`
	Controller string            `json:"controller"` // controller address
	Prefix     string            `json:"prefix"`
	Structure  string            `json:"structure"`
	CreatedAt  time.Time         `json:"created_at"`
}

Table represents a system-wide table stored in Tableland.

func (Table) Name

func (t Table) Name() string

Name returns table's full name.

type TableMetadata

type TableMetadata struct {
	Name         string                   `json:"name,omitempty"`
	ExternalURL  string                   `json:"external_url"`
	Image        string                   `json:"image"`
	Message      string                   `json:"message,omitempty"`
	AnimationURL string                   `json:"animation_url,omitempty"`
	Attributes   []TableMetadataAttribute `json:"attributes,omitempty"`
	Schema       TableSchema              `json:"schema"`
}

TableMetadata represents table metadata (OpenSea standard).

type TableMetadataAttribute

type TableMetadataAttribute struct {
	DisplayType string      `json:"display_type"`
	TraitType   string      `json:"trait_type"`
	Value       interface{} `json:"value"`
}

TableMetadataAttribute represents the table metadata attribute.

type TableSchema

type TableSchema struct {
	Columns          []ColumnSchema
	TableConstraints []string
}

TableSchema represents the schema of a table.

type UserStore

type UserStore interface {
	Read(context.Context, parsing.ReadStmt) (*tableland.TableData, error)
	Close() error
}

UserStore defines the methods for interacting with user data.

Directories

Path Synopsis
system/migrations
Package migrations generated by go-bindata.// sources: migrations/001_init.down.sql migrations/001_init.up.sql migrations/002_receipterroridx.down.sql migrations/002_receipterroridx.up.sql migrations/003_evm_events.down.sql migrations/003_evm_events.up.sql migrations/004_system_id.down.sql migrations/004_system_id.up.sql
Package migrations generated by go-bindata.// sources: migrations/001_init.down.sql migrations/001_init.up.sql migrations/002_receipterroridx.down.sql migrations/002_receipterroridx.up.sql migrations/003_evm_events.down.sql migrations/003_evm_events.up.sql migrations/004_system_id.down.sql migrations/004_system_id.up.sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL