Documentation ¶
Index ¶
- Constants
- Variables
- func NewMongoDataSource() schema.Source
- type MongoDataSource
- func (m *MongoDataSource) Close() error
- func (m *MongoDataSource) DataSource() schema.Source
- func (m *MongoDataSource) Init()
- func (m *MongoDataSource) Open(collectionName string) (schema.Conn, error)
- func (m *MongoDataSource) Setup(ss *schema.SchemaSource) error
- func (m *MongoDataSource) Table(table string) (*schema.Table, error)
- func (m *MongoDataSource) Tables() []string
- type ResultReader
- type ResultReaderNext
- type SqlToMgo
Constants ¶
View Source
const (
ListenerType = "mongo"
)
Variables ¶
View Source
var (
DefaultLimit = 20
)
Functions ¶
func NewMongoDataSource ¶
Types ¶
type MongoDataSource ¶
type MongoDataSource struct {
// contains filtered or unexported fields
}
Mongo Data Source implements qlbridge DataSource interfaces to mongo server - singleton shared across all sessions/connections - creates connections by mgo.Session.Clone()
func (*MongoDataSource) Close ¶
func (m *MongoDataSource) Close() error
func (*MongoDataSource) DataSource ¶
func (m *MongoDataSource) DataSource() schema.Source
func (*MongoDataSource) Init ¶
func (m *MongoDataSource) Init()
func (*MongoDataSource) Open ¶
func (m *MongoDataSource) Open(collectionName string) (schema.Conn, error)
func (*MongoDataSource) Setup ¶
func (m *MongoDataSource) Setup(ss *schema.SchemaSource) error
func (*MongoDataSource) Table ¶
func (m *MongoDataSource) Table(table string) (*schema.Table, error)
func (*MongoDataSource) Tables ¶
func (m *MongoDataSource) Tables() []string
type ResultReader ¶
type ResultReader struct { *exec.TaskBase Docs []u.JsonHelper Vals [][]driver.Value Total int Aggs u.JsonHelper ScrollId string // contains filtered or unexported fields }
Mongo ResultReader implements result paging, reading - driver.Rows
func NewResultReader ¶
func NewResultReader(req *SqlToMgo, q *mgo.Query, limit int) *ResultReader
func (*ResultReader) Close ¶
func (m *ResultReader) Close() error
func (*ResultReader) Run ¶
func (m *ResultReader) Run() 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 SqlToMgo ¶
SqlToMgo Rewrite a Sql AST statement to a Mongo request
- Walk the AST and see what can be pushed down and what can't
- try to poly-fill the missing pieces
- stateful single use request
func NewSqlToMgo ¶
NewSqlToMgo create sql to mongo converter
func (*SqlToMgo) WalkExecSource ¶
Click to show internal directories.
Click to hide internal directories.