Feat: basic implementation for search for auto-completion api#112
Merged
Feat: basic implementation for search for auto-completion api#112
Conversation
Member
guacamole
commented
Mar 5, 2022
- This is the most basic implementation for auto-complete api
- We are using index with text_pattern_ops
- Optimisations to come as we test and integrate it with frontend
jay-dee7
reviewed
Mar 5, 2022
| } | ||
|
|
||
| func (r *registry) GetImageNamespace(ctx echo.Context) error { | ||
| searchQuery := ctx.QueryParam("search_query") |
jay-dee7
reviewed
Mar 5, 2022
router/router.go
Outdated
|
|
||
| // GET /v2/_catalog | ||
| group.Add(http.MethodGet, Catalog, reg.Catalog) | ||
| group.Add(http.MethodGet, "/search", reg.GetImageNamespace) |
Member
There was a problem hiding this comment.
lets put this in a const like we did with Catalog and the path can be /v2/catalog/search
jay-dee7
reviewed
Mar 5, 2022
| @@ -114,4 +114,6 @@ func Docker(group *echo.Group, reg registry.Registry) { | |||
|
|
|||
Member
There was a problem hiding this comment.
Also worth noting that the Function here called Docker can totally be called Extensions
jay-dee7
reviewed
Mar 5, 2022
store/postgres/container_image.go
Outdated
| defer cancel() | ||
| rows, err := p.conn.Query(childCtx, queries.GetImageNamespace, "%"+search+"%") | ||
| if err != nil { | ||
| return nil, err |
Member
There was a problem hiding this comment.
wrap this error with a little description
jay-dee7
reviewed
Mar 5, 2022
store/postgres/container_image.go
Outdated
| for rows.Next() { | ||
| var ns string | ||
| if err := rows.Scan(&ns); err != nil { | ||
| return nil, err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.