Documentation ¶
Overview ¶
Package walkers examples TSL tree walking, and helps to generate SQL and MongoDB query filters. sql.Walk and mongo.Walk methods can be used to create such filters.
Squirrel walk code: https://github.com/yaacov/tsl/blob/master/pkg/walkers/sql/walk.go
SQL generation example: https://github.com/yaacov/tsl/blob/master/cmd/tsl_sqlite/main.go
Usage:
filter, err := sql.Walk(tree) sql, args, err := sq.Select("name, city, state"). From("users"). Where(filter). ToSql()
BSON walk code: https://github.com/yaacov/tsl/blob/master/pkg/walkers/mongo/walk.go
BSON generation example: https://github.com/yaacov/tsl/blob/master/cmd/tsl_mongo/main.go
Usage:
// Prepare a bson filter filter, err = mongo.Walk(tree) // Run query cur, err := collection.Find(ctx, filter)
squirrel: https://github.com/Masterminds/squirrel
mongo-go-driver: https://github.com/mongodb/mongo-go-driver
Directories ¶
Path | Synopsis |
---|---|
Package graphviz helps to create graphviz dot files using the TSL package.
|
Package graphviz helps to create graphviz dot files using the TSL package. |
Package ident helps to replace identifiers in a TSL tree.
|
Package ident helps to replace identifiers in a TSL tree. |
Package mongo helps to create mongo BSON filters using the TSL package.
|
Package mongo helps to create mongo BSON filters using the TSL package. |
Package sql helps to create SQL squirrel filters using the TSL package.
|
Package sql helps to create SQL squirrel filters using the TSL package. |
Click to show internal directories.
Click to hide internal directories.