Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL to describe the "update" clause for an in place update #44

Open
sullivan- opened this issue Sep 22, 2017 · 0 comments
Open

DSL to describe the "update" clause for an in place update #44

sullivan- opened this issue Sep 22, 2017 · 0 comments

Comments

@sullivan-
Copy link
Member

This is prerequisite for any further updateByKeyVal or updateByQuery work.

  • I would recommend keeping it simple at first.
  • Follow longevity.model.query.QueryFilter as a rough model.
  • Basic structure is <prop> 'gets' <update-expr>
    • Provide both an operator (:= maybe) and a pneumonic equivalent such as gets)
  • It's probably a good idea to restrict it to basic properties for the time being (i.e., things like ints and strings, not things like nested components, sets and lists)
  • The update expression will vary by type; LHS and RHS have to match on type
    • update expression should allow for literals, basic properties, and basic operators over the types such as addition, logical or, string concatenation, etc.
  • Please do write some unit tests to make sure the DSL is fluent
  • When in doubt, ask @sullivan- he will be happy to help

In the future, we might add support for things like:

  • collections and nested components
  • specialized operators such as incr that can either rely on underlying DB operators such as MongoDB's $inc, or be expanded into equivalent expression e.g. x + 1
@sullivan- sullivan- changed the title DSL to describe the "update" clause in an in place update DSL to describe the "update" clause for an in place update Sep 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant