sascha@996: delete.all.users = DELETE FROM users sascha@996: delete.all.artifacts = DELETE FROM artifacts sascha@996: user.id.nextval = SELECT NEXTVAL('USERS_ID_SEQ') sascha@996: user.by.gid = SELECT id FROM users WHERE gid = ?::uuid sascha@996: insert.user = INSERT INTO users (id, gid) VALUES (?, ?::uuid) sascha@996: collection.by.gid = SELECT id FROM collections WHERE gid = ?::uuid sascha@996: collection.id.nextval = SELECT NEXTVAL('COLLECTIONS_ID_SEQ') sascha@996: insert.collection = INSERT INTO collections (id, gid, user_id, name) VALUES (?, ?::uuid, ?, ?) sascha@996: artifact.by.gid = SELECT id FROM artifacts WHERE gid = ?::uuid sascha@996: collection.item.id.nextval = SELECT NEXTVAL('COLLECTION_ITEMS_ID_SEQ') sascha@996: insert.collection.item = INSERT INTO collection_items (id, collection_id, artifact_id) VALUES (?, ?, ?) sascha@996: artifact.id.nextval = SELECT NEXTVAL('ARTIFACTS_ID_SEQ') sascha@996: insert.artifact = INSERT INTO artifacts (id, gid, state) VALUES (?, ?::uuid, ?) sascha@996: artifact.data.id.nextval = SELECT NEXTVAL('ARTIFACT_DATA_ID_SEQ') sascha@996: insert.artifact.data = INSERT INTO artifact_data (id, artifact_id, kind, k, v) VALUES (?, ?, ?, ?, ?) sascha@996: out.id.nextval = SELECT NEXTVAL('OUTS_ID_SEQ') sascha@996: insert.out = INSERT INTO outs (id, artifact_id, name, description, out_type) VALUES (?, ?, ?, ?, ?) sascha@996: facet.id.nextval = SELECT NEXTVAL('FACETS_ID_SEQ') sascha@996: 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 = ?::uuid 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 = ?::uuid sascha@1004: delete.user.by.gid = DELETE FROM user WHERE gid = ?::uuid 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 = ?::uuid