sascha@984: delete.all.users = DELETE FROM users sascha@986: user.id.nextval = SELECT NEXTVAL('USERS_ID_SEQ') sascha@986: user.by.gid = SELECT id FROM users WHERE gid = ? sascha@986: insert.user = INSERT INTO users (id, gid) VALUES (?, ?) sascha@987: collection.by.gid = SELECT id FROM collections WHERE gid = ? sascha@987: collection.id.nextval = SELECT NEXTVAL('COLLECTIONS_ID_SEQ') sascha@987: insert.collection = INSERT INTO collections (id, gid, user_id, name) VALUES (?, ?, ?, ?) sascha@988: artifact.by.gid = SELECT id FROM artifacts WHERE gid = ? sascha@988: collection.item.id.nextval = SELECT NEXTVAL('COLLECTION_ITEMS_ID_SEQ') sascha@988: insert.collection.item = INSERT INTO collection_items (id, collection_id, artifact_id) VALUES (?, ?, ?) sascha@989: artifact.id.nextval = SELECT NEXTVAL('ARTIFACTS_ID_SEQ') sascha@989: insert.artifact = INSERT INTO artifacts (id, gid, state) VALUES (?, ?, ?) sascha@990: artifact.data.id.nextval = SELECT NEXTVAL('ARTIFACT_DATA_ID_SEQ') sascha@990: insert.artifact.data = INSERT INTO artifact_data (id, artifact_id, kind, k, v) VALUES (?, ?, ?, ?, ?)