-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.go
43 lines (42 loc) · 1.23 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* @begin 2020-02-27
* @author <a href="mailto:[email protected]">Giuseppe Greco</a>
* @copyright 2020 <a href="skeeterhealth.com">Skeeter</a>
*/
// Package espressopp provides primitives for parsing Espresso++ expressions and
// convert them into native queries.
//
// For example, here below is the code to convert an Espresso++ expression into
// native SQL:
//
// package main
//
// import (
// "bytes"
// "fmt"
// "strings"
//
// "gitlab.com/skeeterhealth/espressopp"
// )
//
// func main() {
// r := strings.NewReader("age gte 30")
// w := new(bytes.Buffer)
//
// interpreter := espressopp.NewEspressoppInterpreter()
// codeGenerator := espressopp.NewSqlCodeGenerator()
// codeGenerator.RenderingOptions.EnableNamedParams()
// err := interpreter.Accept(codeGenerator, r, w)
//
// if err != nil {
// msg := fmt.Errorf("Error generating sql: %v", err)
// fmt.Println(err)
// } else {
// fmt.Println(w.String())
// namedParamValues, _ := codeGenerator.RenderingOptions.GetNamedParamValues()
// for k, v := range namedParamValues {
// fmt.Printf("%s: %s\n", k, v)
// }
// }
// }
package espressopp