translator

package
v1.38.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(mappings []*types.Mapping, queries []*types.Query) (map[*types.Query][]*types.Mapping, error)

Bind binds mapping and query statements.

Types

type Binding

type Binding struct {
	Query   *types.Query
	Mapping *types.Mapping
}

Binding contains a query and mapping object which bind together.

type Constraint

type Constraint struct {
	// Left hand side of an SQL condition
	LHS types.Column
	// Right hand side of an SQL condition
	RHS interface{}
}

Constraint wraps the SQL lhs and rhs variable.

func GetConstraint

func GetConstraint(
	graph Graph,
	funcDeps map[types.Entity]map[string]interface{}) ([]Constraint, map[types.Node]string, error)

GetConstraint obtains a list of constraints object that can be used to construct SQL query.

type Graph

type Graph map[interface{}]map[interface{}]struct{}

Graph represents the struct for terms matching.

func (Graph) String

func (graph Graph) String() string

String gets the string reprentation of a graph.

type ProvInfo

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

ProvInfo contains the provenance query metadata

type Translation

type Translation struct {
	SQL        string
	Nodes      []types.Node
	Bindings   []Binding
	Constraint []Constraint
	Prov       map[int][]int
}

Translation contains the translated result.

func Translate

func Translate(
	mappings []*types.Mapping, nodes []types.Node, queries []*types.Query,
	subTypeMap map[string]string, options ...*types.QueryOptions) (
	*Translation, error)

Translate takes a datalog query and translates to GoogleSQL query based on schema mapping.

Directories

Path Synopsis
Package sparql parses Sparql query for translation.
Package sparql parses Sparql query for translation.

Jump to

Keyboard shortcuts

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