Skip to content

Query update APPLY #125

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

Merged
merged 1 commit into from
Dec 22, 2014
Merged

Query update APPLY #125

merged 1 commit into from
Dec 22, 2014

Conversation

dantleech
Copy link
Member

  • Allow applying a function to result sets
  • Added apply functions "mixin_add" and "mixin_remove"
PHPCRSH> UPDATE [nt:unstructured] APPLY mixin_add('mix:foobar'), mixin_remove('bar:foo')

Fixes #99

Other things we could add:

  • lock: Lock the node
  • primary_type: Set primary type
  • lock_refresh
  • lock_token_add
  • lock_token_remove
  • unlock
  • lifecycle_follow
  • property_set: Alternative to SET a = b
  • retention_hold_add
  • retention_hold_remove

@dantleech
Copy link
Member Author

@dbu any other low hanging fruit for the APPLY method?

It would be nice to be able to set the primary node type, but thats not possible in Jackrabbit - and I guess not in DBAL currently?

@dbu
Copy link
Member

dbu commented Dec 22, 2014

setting primary type would require jackalope/jackalope#247 - apart from that it makes sense to support it here...

i would be -1 on an alternate to SET a=b - there should be only one way to do one thing. (if this is internally using the same mechanism, that is all fine by me).

locking without a lock token only makes sense within a session. you could try it though, so i could lock something in the shell, then do my stuff, then release the lock. lock with token is not supported yet by jackalope (but would make more sense in web applications than the locks we already support). dbal does not support any locking at all.

the syntax seems fine to me, we can always add more things as they come up.

@dbu
Copy link
Member

dbu commented Dec 22, 2014

looked over the code. i am quite impressed with how little changes you can implement this feature!

it looks like the mixin:remove fails. are you using dbal or jackrabbit for the tests? could be jackrabbit does not support removing a mixin - not sure though.

- Allow applying a function to result sets
- Added apply functions "mixin_add" and "mixin_remove"
@dantleech
Copy link
Member Author

Thanks :)
.
The failure is due to fixture failures .. I think next time I write tests like this I will declare the fixtures in the behat feature instead of loading external fixtures. The tests are currently kinda interdependent.

For now we can just have mixin_add and mixin_remove.. the others can come later.

dantleech added a commit that referenced this pull request Dec 22, 2014
@dantleech dantleech merged commit 4d52a5c into master Dec 22, 2014
@dantleech dantleech deleted the query_apply branch December 22, 2014 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QUERY] APPLY functions to node, e.g. for adding/removing node types
3 participants