sourcegraph/lib
Joe Chen ce025a069a
enterprise-portal: init database schema and handler store (#63139)
Part of CORE-99

This PR scaffolds the database schema and code structure based on
[CORE-99
comment](https://linear.app/sourcegraph/issue/CORE-99/enterprise-portal-design-sams-user-to-subscription-rpcs#comment-8105ac31)
with some modifications. See inline comments for more elaborations.
- It uses GORM's ONLY for auto migration, just to kick things off, we
may migrate to file-based migration like we are planning for SAMS.
- It then uses the `*pgxpool.Pool` as the DB interface for executing
business logic queries.

Additionally, refactored `subscriptionsservice/v1.go` to use a `Store`
that provide single interface for accessing data(base), as we have been
doing in SAMS and SSC.

## Test plan

Enterprise Portal starts locally, and database is initialized:

![CleanShot 2024-06-06 at 17 02
42@2x](https://github.com/sourcegraph/sourcegraph/assets/2946214/f6cbc2bf-bd95-4691-9f87-b2450cc31e4d)
2024-06-06 18:54:12 -04:00
..
accesstoken chore: Expose ParsePersonalAccessToken publicly for src-cli (#62587) 2024-05-10 19:32:14 +08:00
api enterprise: Move last directory out (#57392) 2023-10-05 20:15:40 +00:00
background feat/lib/background: mark goroutine names as safe for Sentry (#63010) 2024-05-31 17:58:43 +00:00
batches chore: Change errors.HasType to respect multi-errors (#63024) 2024-06-06 13:02:14 +00:00
cliutil sg: improve positional completions (#58569) 2023-11-27 16:30:59 -08:00
codeintel feat(search): Add Syntax Highlighting for Magik language (#62919) 2024-06-06 16:49:07 -04:00
enterpriseportal enterprise-portal: rename "scope" to "permission" for query RPC (#63137) 2024-06-06 19:40:15 +00:00
errors chore: Change errors.HasType to respect multi-errors (#63024) 2024-06-06 13:02:14 +00:00
gitservice bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
iterator ci: re-enable race detection (#52776) 2023-06-05 20:41:47 +02:00
managedservicesplatform enterprise-portal: init database schema and handler store (#63139) 2024-06-06 18:54:12 -04:00
output sg/msp: filter generated environments by category (#62131) 2024-04-24 09:44:16 -07:00
pointers msp: add monitoring stack (#58816) 2023-12-13 19:40:57 +00:00
process bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
servicecatalog bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
telemetrygateway bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
buf.yaml lib/enterpriseportal: initial service API for RFC 885 (#62263) 2024-05-15 12:58:55 -07:00
go.mod chore(tooling): bump Go version to 1.22.4 (#63124) 2024-06-06 15:19:03 +00:00
go.sum chore: Add tests documenting error invariants (#62992) 2024-06-03 19:46:53 +08:00
README.md lib: Introduce non-enterprise lib directory (#18992) 2021-03-10 19:41:33 -06:00
tools.go bump to Go 1.22.1 (#60902) 2024-03-06 17:38:43 -07:00

Sourcegraph lib module

This directory is the root of a separate go module from the primary module rooted at sourcegraph/sourcegraph. This module exists to hold code that we want to reuse outside of the sourcegraph/sourcegraph repo.

Code in this module should not import from sourcegraph/sourcegraph or from other Sourcegraph repositories to avoid complicated dependency relationships. Instead consider moving code from elsewhere into this module.