sascha@14: artifacts.id.nextval=SELECT NEXTVAL('ARTIFACTS_ID_SEQ') sascha@14: sascha@14: artifacts.insert=INSERT INTO artifacts \ sascha@32: (id, gid, creation, last_access, ttl, data) \ sascha@32: VALUES (?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, ?, data) sascha@14: sascha@14: artifacts.update=UPDATE artifacts SET last_access = CURRENT_TIMESTAMP, \ sascha@14: data = ? WHERE id = ? sascha@14: sascha@14: artifacts.touch=UPDATE last_access = CURRENT_TIMESTAMP WHERE id = ? sascha@14: sascha@30: artifacts.outdated=SELECT id, data FROM artifacts WHERE ttl IS NOT NULL \ sascha@30: AND CURRENT_TIMESTAMP - last_access > ttl LIMIT 50 sascha@14: sascha@14: artifacts.select.gid=SELECT id, last_access, ttl, data FROM artifacts WHERE gid = ? sascha@14: sascha@14: artifacts.delete=DELETE FROM artifacts WHERE id = ?