For now I've decided to play safe and I've added a added an 'ok' column to tell 
me if I'm within 5s of an update.

> CREATE VIEW near_update as select count(*) as n from aliases where 
> abs(strftime('%s', 'now') - validFrom) < 5;
> CREATE VIEW alias_info as select a.name, s.url, s.type, nu.n == 0 as ok from 
> latest_aliases as a join services as s on a.assignedTo = s.name join 
> near_update as nu;

In the scripts, I just need to check the ok column, and if it's 0, then return 
a temporary error to the client.

Probably not the nicest solution, but it keeps complicated sql out of the 
scripts, and makes sure all the services reported back are always in sync - 
which are my main aims. Plus, there are only likely to be a few updates a 
month, most in the middle of the night, so the occasional temporary error won't 
be a problem.

On 22 Jul 2012, at 21:54, Keith Medcalf wrote:

> if they are tiny, then it matters not, if they will always be tiny


Yeah, we're not anticipating many updates, and eventually, I intend writing a 
cron script to clear the old ones out.

Thanks,
Kevin


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to