Skip to content

Instantly share code, notes, and snippets.

@gaspard
Last active December 4, 2018 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaspard/7603cf271fe5f389c0aaebeff745d28d to your computer and use it in GitHub Desktop.
Save gaspard/7603cf271fe5f389c0aaebeff745d28d to your computer and use it in GitHub Desktop.
SELECT "item"."id" AS "item_id",
"item"."type" AS "item_type",
"item"."savedat" AS "item_savedAt",
"item"."creator" AS "item_creator",
"item"."createdat" AS "item_createdAt",
"item"."editor" AS "item_editor",
"item"."editedat" AS "item_editedAt",
"item"."accesschangedby" AS "item_accessChangedBy",
"item"."accesschangedat" AS "item_accessChangedAt",
"item"."revision" AS "item_revision",
"item"."content" AS "item_content",
"item"."deleted" AS "item_deleted",
"item"."collectionaccess" AS "item_collectionAccess",
"item"."useraccess" AS "item_userAccess",
"item"."accesschangelog" AS "item_accessChangeLog",
"item"."signature" AS "item_signature",
"collections"."id" AS "collections_id",
"collections"."type" AS "collections_type",
"collections"."savedat" AS "collections_savedAt",
"collections"."creator" AS "collections_creator",
"collections"."createdat" AS "collections_createdAt",
"collections"."editor" AS "collections_editor",
"collections"."editedat" AS "collections_editedAt",
"collections"."accesschangedby" AS "collections_accessChangedBy",
"collections"."accesschangedat" AS "collections_accessChangedAt",
"collections"."revision" AS "collections_revision",
"collections"."content" AS "collections_content",
"collections"."deleted" AS "collections_deleted",
"collections"."collectionaccess" AS "collections_collectionAccess",
"collections"."useraccess" AS "collections_userAccess",
"collections"."accesschangelog" AS "collections_accessChangeLog",
"collections"."signature" AS "collections_signature",
"collectionUsers"."id" AS "collectionUsers_id",
"collectionUsers"."type" AS "collectionUsers_type",
"collectionUsers"."username" AS "collectionUsers_username",
"collectionUsers"."email" AS "collectionUsers_email",
"collectionUsers"."savedat" AS "collectionUsers_savedAt",
"collectionUsers"."onlineat" AS "collectionUsers_onlineAt",
"collectionUsers"."privatekeys" AS "collectionUsers_privateKeys",
"collectionUsers"."publickeys" AS "collectionUsers_publicKeys"
FROM "item" "item"
INNER JOIN "item_item_collections" "collections_item"
ON "collections_item"."itemid_2" = "item"."id"
INNER JOIN "item" "collections"
ON "collections"."id" = "collections_item"."itemid_1"
INNER JOIN "item_collection_users" "collections_collectionUsers"
ON "collections_collectionUsers"."itemid" = "collections"."id"
INNER JOIN "user" "collectionUsers"
ON "collectionUsers"."id" =
"collections_collectionUsers"."userid"
WHERE "item"."id" = ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment