AsOf / Since

Tests…

getAsOf(t) and getSince are complementary functions that either get us a snapshop of the database at some point in time or a current snapshot filtered with only changes after a point in time. Like before/after scenarios.

AsOf

Temp test

Calling getAsOf(t) on a molecule gives us the data as of a certain point in time like t4:


As we saw in point in time, a t can be either a transaction entity id like tx4, a transaction number t4 or a java.util.Date like date4. So we could get to the same data in 3 different ways:

Person.name.age.getAsOf(tx4) === ... // Persons as of transaction entity id `tx4` (inclusive)
 
Person.name.age.getAsOf(t4) === ... // Persons as of transaction value `t4` (inclusive) 

Person.name.age.getAsOf(date4) === ... // Persons as of some Date `date4` (inclusive) 

Note that t is “inclusive” meaning that it is how the database looked right after transaction tx4, t4 or date4.

Since

Tests…

As a complementary function to getAsOf(t) we have getSince(t) that gives us a snapshot of the current database filtered with only changes added after/since t:


In this case the t is not included

Person.name.age.getSince(tx4) === ... // Persons added since/after transaction entity id `tx4` (exclusive)
 
Person.name.age.getSince(t4) === ... // Persons added since/after transaction value `t4` (exclusive) 

Person.name.age.getSince(date4) === ... // Persons added since/after some Date `date4` (exclusive) 

Next

History…