github.com/mitranim/sqlb@v0.7.2/t_example_bui_test.go (about) 1 package sqlb_test 2 3 import ( 4 "fmt" 5 6 s "github.com/mitranim/sqlb" 7 ) 8 9 func ExampleBui() { 10 fmt.Println(s.Reify(SomeExpr{})) 11 // Output: 12 // select $1 [some_value] 13 } 14 15 type SomeExpr struct{} 16 17 func (self SomeExpr) AppendExpr(text []byte, args []any) ([]byte, []any) { 18 bui := s.Bui{text, args} 19 bui.Str(`select`) 20 bui.Any(`some_value`) 21 return bui.Get() 22 }