steampipe-plugin-gitlab icon indicating copy to clipboard operation
steampipe-plugin-gitlab copied to clipboard

Unable to query gitlab_user with a join

Open xonstone opened this issue 1 year ago • 1 comments

Hi

I'm trying to query the gitlab_user table with users that are in a group: gitlab_group_member but I keep running into the same error. This is on gitlab.com:

Query 1 ERROR at Line 1: : ERROR:  rpc error: code = Unknown desc = when using the gitlab_user table with GitLab Cloud, `List` call requires an '=' qualifier for one or more of the following columns: 'id', 'username'

This are the queries I tried:

SELECT
	*
FROM
	gitlab_group_member AS m,
	gitlab_user AS u
WHERE
	u.id = m.id
	AND group_id = <group_id>;
SELECT
	*
FROM (
	SELECT
		id AS group_member_id
	FROM
		gitlab_group_member
	WHERE
		group_id = <group_id>) AS m, gitlab_user
WHERE
	id = group_member_id;
SELECT
	*
FROM
	gitlab_group_member AS m
	JOIN gitlab_user AS u ON u.id = m.id
WHERE
	group_id = <group_id>;

xonstone avatar Jul 04 '24 07:07 xonstone