schema

package
v0.18.6 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

Tracker contains the required fields to perform schema tracking.

func NewTracker

func NewTracker(ch chan *discovery.TabletHealth, enableViews bool) *Tracker

NewTracker creates the tracker object.

func (*Tracker) AddNewKeyspace

func (t *Tracker) AddNewKeyspace(conn queryservice.QueryService, target *querypb.Target) error

AddNewKeyspace adds keyspace to the tracker.

func (*Tracker) GetColumns

func (t *Tracker) GetColumns(ks string, tbl string) []vindexes.Column

GetColumns returns the column list for table in the given keyspace.

func (*Tracker) GetForeignKeys added in v0.18.0

func (t *Tracker) GetForeignKeys(ks string, tbl string) []*sqlparser.ForeignKeyDefinition

GetForeignKeys returns the foreign keys for table in the given keyspace.

func (*Tracker) GetViews added in v0.16.0

func (t *Tracker) GetViews(ks string, tbl string) sqlparser.SelectStatement

GetViews returns the view statement for the given keyspace and view name.

func (*Tracker) LoadKeyspace

func (t *Tracker) LoadKeyspace(conn queryservice.QueryService, target *querypb.Target) error

LoadKeyspace loads the keyspace schema.

func (*Tracker) RegisterSignalReceiver

func (t *Tracker) RegisterSignalReceiver(f func())

RegisterSignalReceiver allows a function to register to be called when new schema is available

func (*Tracker) Start

func (t *Tracker) Start()

Start starts the schema tracking.

func (*Tracker) Stop

func (t *Tracker) Stop()

Stop stops the schema tracking

func (*Tracker) Tables

func (t *Tracker) Tables(ks string) map[string]*vindexes.TableInfo

Tables returns a map with the columns for all known tables in the keyspace

func (*Tracker) Views added in v0.16.0

func (t *Tracker) Views(ks string) map[string]sqlparser.SelectStatement

Views returns all known views in the keyspace with their definition.

Jump to

Keyboard shortcuts

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