Documentation
¶
Index ¶
- func LimitQuery(q string, limit int64) string
- func RunQuery(ctx context.Context, client *mongo.Client, defaultDatabase, queryStr string) (*query.QueryResult, error)
- type Config
- type DB
- func (db *DB) GetIngestrURI() (string, error)
- func (db *DB) Limit(q string, limit int64) string
- func (db *DB) Ping(ctx context.Context) error
- func (db *DB) Select(ctx context.Context, q *query.Query) ([][]interface{}, error)
- func (db *DB) SelectWithSchema(ctx context.Context, q *query.Query) (*query.QueryResult, error)
- type MongoConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LimitQuery ¶ added in v0.11.644
LimitQuery lets `bruin query --limit N` work for MongoDB by injecting the limit into the query envelope. If the query can't be parsed it is returned as-is. Shared by the mongo and mongo_atlas connection types.
func RunQuery ¶ added in v0.11.644
func RunQuery(ctx context.Context, client *mongo.Client, defaultDatabase, queryStr string) (*query.QueryResult, error)
RunQuery executes a MongoDB query envelope against the given client and returns a tabular result. defaultDatabase is used when the envelope omits a "database". It is shared by the mongo and mongo_atlas connection types.
Types ¶
type Config ¶
func (*Config) GetIngestrURI ¶
type DB ¶
type DB struct {
Name string
// contains filtered or unexported fields
}
func (*DB) GetIngestrURI ¶
func (*DB) SelectWithSchema ¶ added in v0.11.644
type MongoConnection ¶
Click to show internal directories.
Click to hide internal directories.