aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module_test.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2021-01-29 17:19:23 -0500
committerJonathan Amsterdam <jba@google.com>2021-02-02 19:35:44 +0000
commit1fe92ed1d8906c5c7253e7f1f03cb008e08a640c (patch)
tree9076112b55629447f62d6578ae18ebce4d540dee /internal/postgres/insert_module_test.go
parente30379b0eb5700abc996dbb9a2541e0d4762e8c4 (diff)
downloadgo-x-pkgsite-1fe92ed1d8906c5c7253e7f1f03cb008e08a640c.tar.xz
internal/postgres: make query work with multiple build contexts
The query for getting packages under a path (i.e. subdirectories) implicitly assumes that there is only row in the documentation table for each package. Remove that assumption. We can't simply adjust the query, because when there are multiple rows we prefer the one with the "best" build context, as defined by the ordering of internal.BuildContexts. We can't embed that ordering into a SQL query. So we read everything and sort afterwards. For golang/go#37232 Change-Id: Ie12d0a98072bf8e943d743a3b9b763e267fd9e26 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288216 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/postgres/insert_module_test.go')
0 files changed, 0 insertions, 0 deletions