Documentation ¶
Overview ¶
Package planbuilder allows you to build execution plans that describe how to fulfill a query that may span multiple keyspaces or shards. The main entry points for this package are Build and BuildFromStmt.
Index ¶
Constants ¶
View Source
const ( // DirectiveMultiShardAutocommit is the query comment directive to allow // single round trip autocommit with a multi-shard statement. DirectiveMultiShardAutocommit = "MULTI_SHARD_AUTOCOMMIT" )
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(query string, vschema ContextVSchema) (*engine.Plan, error)
Build builds a plan for a query based on the specified vschema. It's the main entry point for this package.
func BuildFromStmt ¶
func BuildFromStmt(query string, stmt sqlparser.Statement, vschema ContextVSchema) (*engine.Plan, error)
BuildFromStmt builds a plan based on the AST provided. TODO(sougou): The query input is trusted as the source of the AST. Maybe this function just returns instructions and engine.Plan can be built by the caller.
Types ¶
type ContextVSchema ¶
type ContextVSchema interface { FindTable(tablename sqlparser.TableName) (*vindexes.Table, string, topodatapb.TabletType, key.Destination, error) FindTableOrVindex(tablename sqlparser.TableName) (*vindexes.Table, vindexes.Vindex, string, topodatapb.TabletType, key.Destination, error) DefaultKeyspace() (*vindexes.Keyspace, error) }
ContextVSchema defines the interface for this package to fetch info about tables.
Click to show internal directories.
Click to hide internal directories.