Documentation ¶
Overview ¶
Package datastore is a source adapter for Google DataStore into dataux to allow mysql querying against datastore.
Index ¶
- Constants
- Variables
- type DatastoreMutator
- type ResultReader
- type ResultReaderNext
- type Row
- type SQLToDatstore
- func (m *SQLToDatstore) CreateMutator(pc interface{}) (schema.ConnMutator, error)
- func (m *SQLToDatstore) Delete(key driver.Value) (int, error)
- func (m *SQLToDatstore) DeleteExpression(pln interface{}, where expr.Node) (int, error)
- func (m *SQLToDatstore) Put(ctx context.Context, key schema.Key, val interface{}) (schema.Key, error)
- func (m *SQLToDatstore) PutMulti(ctx context.Context, keys []schema.Key, src interface{}) ([]schema.Key, error)
- func (m *SQLToDatstore) WalkExecSource(p *plan.Source) (exec.Task, error)
- func (m *SQLToDatstore) WalkSourceSelect(planner plan.Planner, p *plan.Source) (plan.Task, error)
- func (m *SQLToDatstore) WalkWhereNode(cur expr.Node) error
- type Source
- func (m *Source) Close() error
- func (m *Source) DataSource() schema.Source
- func (m *Source) Init()
- func (m *Source) Open(tableName string) (schema.Conn, error)
- func (m *Source) Setup(ss *schema.Schema) error
- func (m *Source) Table(table string) (*schema.Table, error)
- func (m *Source) Tables() []string
Constants ¶
const (
// SourceType is the Type label for global source type registery.
SourceType = "google-datastore"
)
Variables ¶
var (
// DefaultLimit LIMIT on DataStore Queries
DefaultLimit = 1000
)
var ( // ErrNoSchema no schema found for datastore ErrNoSchema = fmt.Errorf("No schema or configuration exists") )
Functions ¶
This section is empty.
Types ¶
type DatastoreMutator ¶
type DatastoreMutator struct {
// contains filtered or unexported fields
}
DatastoreMutator is a connection for mutation
type ResultReader ¶
type ResultReader struct { *exec.TaskBase Vals [][]driver.Value Total int Req *SQLToDatstore // contains filtered or unexported fields }
ResultReader for Google Datastore implements result paging, reading from datastore types into generic sql types - driver.Rows
func NewResultReader ¶
func NewResultReader(req *SQLToDatstore) *ResultReader
func (*ResultReader) Close ¶
func (m *ResultReader) Close() error
func (*ResultReader) Run ¶
func (m *ResultReader) Run() error
Run takes sql query which has been translated into a google datastore the Google Datastore properties into
[][]interface{} which is compabitble with sql/driver values
as well as making a projection, ie column selection
type ResultReaderNext ¶
type ResultReaderNext struct {
*ResultReader
}
ResultReaderNext A wrapper, allowing us to implement sql/driver Next() interface
which is different than qlbridge/datasource Next()
type SQLToDatstore ¶
SQLToDatstore transforms a Sql AST statement into a Google Datastore request - a dialect translator (sql -> datastore query languages) - matches Task interface to operate in qlbridge exec interfaces
func NewSQLToDatstore ¶
func NewSQLToDatstore(table *schema.Table, cl *datastore.Client, ctx context.Context) *SQLToDatstore
NewSQLToDatstore Create a new translator to re-write a SQL AST query into google data store
func (*SQLToDatstore) CreateMutator ¶
func (m *SQLToDatstore) CreateMutator(pc interface{}) (schema.ConnMutator, error)
CreateMutator interface allowing a connection for mutation.
func (*SQLToDatstore) DeleteExpression ¶
func (m *SQLToDatstore) DeleteExpression(pln interface{}, where expr.Node) (int, error)
func (*SQLToDatstore) Put ¶
func (m *SQLToDatstore) Put(ctx context.Context, key schema.Key, val interface{}) (schema.Key, error)
Put interface for Upsert.Put()
func (*SQLToDatstore) WalkExecSource ¶
WalkExecSource part of planner interface allowing sources to do their own execution planning.
func (*SQLToDatstore) WalkSourceSelect ¶
WalkSourceSelect part of planner interface for source.
func (*SQLToDatstore) WalkWhereNode ¶
func (m *SQLToDatstore) WalkWhereNode(cur expr.Node) error
WalkWhereNode an expression, and its AND logic to create an appropriately request for google datastore queries
Limititations of Google Datastore - https://cloud.google.com/datastore/docs/concepts/queries#Datastore_Restrictions_on_queries - no OR filters