Closed flycash closed 2 years ago
Please check existing issues first to avoid duplication and answer the questions below before submitting your issue.
(Please state use cases, what problem will this feature solve?)
Predicates are used to filter rows. Predicate can be used in WHERE clause.
Predicate
(Please describe your proposed design/solution, if any) Here are the major APIs and you can find them in predicate.go:
predicate.go
// P creates a Predicate // left could be string or Expr func P(left interface{}) Predicate { panic("implement me") } // Not indicates "NOT" func Not(p Predicate) Predicate { panic("implement me") } // And indicates "AND" func (p Predicate) And(pred Predicate) Predicate { panic("implement me") } // Or indicates "OR" func (p Predicate) Or(pred Predicate) Predicate { panic("implement me") } // EQ = func (p Predicate) EQ(val interface{}) Predicate { panic("implement") } // LT < func (p Predicate) LT(val interface{}) Predicate { panic("implement me") } // GT > func (p Predicate) GT(val interface{}) Predicate { panic("implement me") }
But the most important things is to convert the predicates to string. For example:
P("id").LT(10)// `id` < 10
(Other possible options for solving the problem?)
It relies on #10
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
(If you can, link to the line of code that might be helpful to explain the context)
For this issue, we don't need to support complicate expression, we just support simple comparison.
ok,I will complete this method
This issue is inactive for a long time.
English Only
Please check existing issues first to avoid duplication and answer the questions below before submitting your issue.
Use case(s)
(Please state use cases, what problem will this feature solve?)
Predicates are used to filter rows.
Predicate
can be used in WHERE clause.Proposed Solution
(Please describe your proposed design/solution, if any) Here are the major APIs and you can find them in
predicate.go
:But the most important things is to convert the predicates to string. For example:
Alternatives Considered
(Other possible options for solving the problem?)
Additional Context
It relies on #10
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
(If you can, link to the line of code that might be helpful to explain the context)