Documentation ¶
Index ¶
- Constants
- Variables
- type DatastoreMutator
- type GoogleDSDataSource
- func (m *GoogleDSDataSource) Close() error
- func (m *GoogleDSDataSource) DataSource() schema.Source
- func (m *GoogleDSDataSource) Open(tableName string) (schema.Conn, error)
- func (m *GoogleDSDataSource) Setup(ss *schema.SchemaSource) error
- func (m *GoogleDSDataSource) Table(table string) (*schema.Table, error)
- func (m *GoogleDSDataSource) Tables() []string
- 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
Constants ¶
const (
DataSourceLabel = "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 GoogleDSDataSource ¶
type GoogleDSDataSource struct {
// contains filtered or unexported fields
}
Google Datastore Data Source, is a singleton, non-threadsafe connection
to a backend mongo server
func (*GoogleDSDataSource) Close ¶
func (m *GoogleDSDataSource) Close() error
func (*GoogleDSDataSource) DataSource ¶
func (m *GoogleDSDataSource) DataSource() schema.Source
func (*GoogleDSDataSource) Open ¶
func (m *GoogleDSDataSource) Open(tableName string) (schema.Conn, error)
func (*GoogleDSDataSource) Setup ¶
func (m *GoogleDSDataSource) Setup(ss *schema.SchemaSource) error
func (*GoogleDSDataSource) Table ¶
func (m *GoogleDSDataSource) Table(table string) (*schema.Table, error)
func (*GoogleDSDataSource) Tables ¶
func (m *GoogleDSDataSource) Tables() []string
type ResultReader ¶
type ResultReader struct { *exec.TaskBase Vals [][]driver.Value Total int Req *SqlToDatstore // contains filtered or unexported fields }
Google Datastore ResultReader implements result paging, reading - 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
Runs the Google Datastore properties into
[][]interface{} which is compabitble with sql/driver values
as well as making a projection, ie column selection
func (m *ResultReader) Finalize() error {
type ResultReaderNext ¶
type ResultReaderNext struct {
*ResultReader
}
A wrapper, allowing us to implement sql/driver Next() interface
which is different than qlbridge/datasource Next()
type SqlToDatstore ¶
Sql To Google Datastore Maps a Sql request into an equivalent
google data store query
- a dialect translator
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 -