Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MG-2214 - Add LTREE Path to Groups #2223

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

WashingtonKK
Copy link
Contributor

What type of PR is this?

This is a feature because it adds LTREE to groups.

What does this do?

This adds ltree to groups

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes, I have included tests for my changes.

Did you document any new/modified feature?

Yes, I have updated the documentation for the new feature.

Notes

Signed-off-by: WashingtonKK [email protected]

@@ -52,6 +52,7 @@ type MembersPage struct {
// of Groups that belong to the page.
type Page struct {
PageMeta
Type string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

}
return query
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we returning?

}
if gm.ID == "" {
q = `SELECT DISTINCT g.id, g.domain_id, COALESCE(g.parent_id, '') AS parent_id, g.name, g.description,
g.metadata, g.created_at, g.updated_at, g.updated_by, g.status FROM groups g`
g.metadata, g.created_at, g.updated_at, g.updated_by, g.status, nlevel(path) as level, g.path FROM groups g`
query = buildQuery(gm, "WHERE")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the WHERE and AND clauses in buildquery

return query
}
path = parent.Path + "." + g.ID
if len(strings.Split(path, ".")) > 20 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this magic number

Signed-off-by: WashingtonKK <[email protected]>

feat(groups): ffetch groups using ltree

Signed-off-by: WashingtonKK <[email protected]>

fix(groups): remove lquery

Signed-off-by: WashingtonKK <[email protected]>

feat(groups): add index

Signed-off-by: WashingtonKK <[email protected]>

fix(groups): handle empty response body

Signed-off-by: WashingtonKK <[email protected]>

refactor groups for test

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>

refactor: ltree in groups

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>

fix: tests

Signed-off-by: WashingtonKK <[email protected]>

fix: tests

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>

fix ci

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add LTREE Path in Groups
2 participants