News for hackers. Stuff that matters.
Re:Cue: A new language for data validation by znt on Tuesday October 19, 2021 @08:10AM (#28917222)
How do we handle interdependent validation between different fields?

Let's say I got begin date and end date, and I'd like to ensure end date always comes after begin date.

Re:Cue: A new language for data validation by k37dhn3 on Tuesday October 19, 2021 @09:40AM (#28917963)
Here is a generic example: https://cuelang.org/play/?id=LerWxMboqQQ#cue@export@cue

Try changing the values of before and after

Re:Cue: A new language for data validation by verdverm on Tuesday October 19, 2021 @08:48PM (#28925553)
More generally speaking, CUE has overlap with propagator networks.

Given

x = y + 1 y = x - 1

You can specify either x or y and the other will be solved for. A more powerful PN system can be built on CUE, especially given the DAG solver in the code base

Re:Cue: A new language for data validation by gregwebs on Tuesday October 19, 2021 @09:37AM (#28917935)
There’s a separate API for dates but for numbers:

  begin: …
  end: …
  #before: < end
  v: before & begin