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