-
Notifications
You must be signed in to change notification settings - Fork 671
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
base: main
Are you sure you want to change the base?
Conversation
c8c66bc
to
603cf33
Compare
8ad1f1d
to
500d5a8
Compare
22b50ae
to
9fb398c
Compare
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> feat(groups): ffetch groups using ltree Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> fix(groups): remove lquery Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> feat(groups): add index Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> fix(groups): handle empty response body Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> refactor groups for test Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> refactor: ltree in groups Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> fix: tests Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> fix: tests Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> fix ci Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
path = parent.Path + "." + g.ID | ||
if len(strings.Split(path, ".")) > mggroups.MaxPathLength { | ||
path = parent.ID + "." + g.ID | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should return error
parent, err := repo.RetrieveByID(c, g.Parent) | ||
if err != nil { | ||
query = `INSERT INTO groups (name, description, id, domain_id, parent_id, metadata, created_at, status, path) | ||
VALUES (:name, :description, :id, :domain_id, :parent_id, :metadata, :created_at, :status, :id) | ||
RETURNING id, name, description, domain_id, COALESCE(parent_id, '') AS parent_id, metadata, created_at, status, path, nlevel(path) as level;` | ||
return query | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if parent group retrieve failed, then it should return error
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add return here
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 washingtonkigan@gmail.com