mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
This change introduces an `mi2`-like experience for interacting with MSP databases. By default we use the new readonly-SA introduced in https://github.com/sourcegraph/sourcegraph/pull/59105, otherwise with the `--write-access` flag you can connect as the same user as the Cloud Run workload, which gives a lot more permissions. An alias, `sg msp pg connect`, is available for those less inclined to type out the entire `postgresql` subcommand name. Closes https://github.com/sourcegraph/managed-services/issues/207 ## Test plan Applied to `msp-testbed`, which has a PG instance and provisioned tables. Try both service accounts: ``` sg msp pg connect --write-access msp-testbed test sg msp pg connect msp-testbed test ```  With both of the above: ``` primary=> select * from users; id | created_at | updated_at | deleted_at | external_id | name | avatar_url ----+------------+------------+------------+-------------+------+------------ (0 rows) ```
18 lines
429 B
Python
18 lines
429 B
Python
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
|
|
|
go_library(
|
|
name = "cloudsqlproxy",
|
|
srcs = [
|
|
"binary.go",
|
|
"cloudsqlproxy.go",
|
|
],
|
|
importpath = "github.com/sourcegraph/sourcegraph/dev/sg/cloudsqlproxy",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//dev/sg/internal/std",
|
|
"//lib/errors",
|
|
"//lib/output",
|
|
"@com_github_sourcegraph_run//:run",
|
|
],
|
|
)
|