Documentation
¶
Index ¶
- Constants
- Variables
- type DatastoreMutator
- type ResultReader
- type ResultReaderNext
- type Row
- 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.SchemaSource) error
- func (m *Source) Table(table string) (*schema.Table, error)
- func (m *Source) Tables() []string
- 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
Constants ¶
const (
SourceLabel = "google-datastore"
)
Variables ¶
var ( GoogleJwt *string = flag.String("googlejwt", os.Getenv("GOOGLEJWT"), "Path to google JWT oauth token file") GoogleProject *string = flag.String("googleproject", os.Getenv("GOOGLEPROJECT"), "Google Datastore Project Id") ErrNoSchema = fmt.Errorf("No schema or configuration exists") )
var (
// Default LIMIT on DataStore Queries
DefaultLimit = 1000
)
Functions ¶
This section is empty.
Types ¶
type DatastoreMutator ¶
type DatastoreMutator struct {
// contains filtered or unexported fields
}
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 Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source Google Datastore Data Source, is a singleton, non-threadsafe source
to a create connections/clients to datastore
func (*Source) DataSource ¶
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
NewSqlToDatastore 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)
interface for SourceMutation CreateMutator(stmt expr.SqlStatement) (Mutator, error)
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)
interface for Upsert.Put()
func (*SqlToDatstore) WalkExecSource ¶
func (*SqlToDatstore) WalkSourceSelect ¶
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 -