lemmy_server
UPDATE “comment” SET “path” = $1 WHERE (“comment”.“id” = $2) RETURNING “comment”.“id”, “comment”.“creator_id”, “comment”.“post_id”, “comment”.“content”, “comment”.“removed”, “comment”.“published”, “comment”.“updated”, “comment”.“deleted”, “comment”.“ap_id”, “comment”.“local”, “comment”.“path”, “comment”.“distinguished”, “comment”.“language_id”
Wait…, so after an INSERT you have two of these UPDATES to set the id of the comment?
UPDATE “comment” SET “ap_id” = $1 WHERE (“comment”.“id” = $2) RETURNING “comment”.“id”, “comment”.“creator_id”, “comment”.“post_id”, “comment”.“content”, “comment”.“removed”, “comment”.“published”, “comment”.“updated”, “comment”.“deleted”, “comment”.“ap_id”, “comment”.“local”, “comment”.“path”, “comment”.“distinguished”, “comment”.“language_id”
update comment_aggregates ca set child_count = c.child_count from ( select c.id, c.path, count(c2.id) as child_count from comment c join comment c2 on c2.path <@ c.path and c2.path != c.path and c.path <@ $1 group by c.id ) as c where ca.comment_id = c.id
So it seems this code is just raw SQL within the Rust logic…
Is there no whitespace between two Rust functions? I thought that source code was strictly formatted by woodpecker testing?
ok, comment is joining itself?