[Cubicweb] Enhancing `bulk` writes in CubicWeb

Adrien Di Mascio adimasci at gmail.com
Tue May 6 22:40:52 CEST 2014


> Another solution would be to iterate over all constraints and check if
> > there is not a single "record" violating it.
> Can you expand ? I don't get it.

Rather than checking if all modified entities sastisfy all constraints, it
could be possible to check that no entity violates them.

For instance, if you have the following constraint in your schema :

  RQLConstraint('X stop > START, X start START')

you could check that the following quey returns an empty rset :

  "Any X WHERE NOT EXISTS(X stop > START, X start START)"

I don't know which approach would be more efficient. I guess it would
depend on the actual data in the database. If it is accepted that both
solutions have pros and cons, we could let the application developer choose
which policy fits best its data.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20140506/0e468e06/attachment-0165.html>

More information about the Cubicweb mailing list