sascha@984: delete.all.users = DELETE FROM users sascha@996: delete.all.artifacts = DELETE FROM artifacts 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@1025: insert.collection = INSERT INTO collections (id, gid, user_id, name, creation) 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@1025: insert.artifact = INSERT INTO artifacts (id, gid, state, creation) 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 (?, ?, ?, ?, ?) sascha@991: out.id.nextval = SELECT NEXTVAL('OUTS_ID_SEQ') sascha@991: insert.out = INSERT INTO outs (id, artifact_id, name, description, out_type) VALUES (?, ?, ?, ?, ?) sascha@992: facet.id.nextval = SELECT NEXTVAL('FACETS_ID_SEQ') sascha@992: insert.facet = INSERT INTO facets (id, out_id, name, num, state, description) VALUES (?, ?, ?, ?, ?, ?) sascha@1003: sascha@1003: update.collection.name = UPDATE collections SET name = ? WHERE gid = ? sascha@1003: delete.artifact.from.collection = DELETE FROM collection_items WHERE collection_id = ? AND artifact_id = ? sascha@1004: delete.collection.by.gid = DELETE FROM collections WHERE gid = ? sascha@1004: delete.user.by.gid = DELETE FROM user WHERE gid = ? sascha@1004: delete.artifact.data.by.artifact.id = DELETE FROM artifact_data WHERE artifact_id = ? sascha@1004: delete.outs.by.artifact.id = DELETE FROM outs WHERE artifact_id = ? sascha@1004: delete.facets.by.artifact.id = DELETE FROM facets WHERE out_id IN (SELECT id FROM outs WHERE artifact_id = ?) sascha@1006: sascha@1006: delete.artifact.by.gid = DELETE FROM artifacts WHERE gid = ?