github.com/kcmvp/gob@v1.0.17/dbx/query.go (about) 1 // nolint 2 package dbx 3 4 import ( 5 "github.com/samber/lo" 6 ) 7 8 type Joint lo.Tuple3[Attr, Attr, string] 9 10 func (joint Joint) String() string { 11 return "" 12 } 13 14 type Result struct { 15 raw map[string]any 16 attrs []Attr //nolint 17 } 18 19 func (result Result) Get(attr Attr) (any, error) { 20 return nil, nil 21 } 22 23 func (result Result) Count() int { 24 return len(result.raw) 25 } 26 27 type Query struct { 28 jointStr string 29 } 30 31 func Select(attrs []Attr) Query { 32 //@todo validate 33 return Query{} 34 } 35 36 func (query Query) WithJoin(joints []Joint) Query { 37 //@todo validate 38 return Query{} 39 } 40 41 func (query Query) OrderBy(orders []OrderBy) Query { 42 return Query{} 43 } 44 45 func (query Query) Where(criteria Criteria, values func() []any) Query { 46 return Query{} 47 } 48 49 func (query Query) Rows() Result { 50 return Result{} 51 }