Documentation
¶
Overview ¶
Package studio serves melange studio: a local, read-only web console over a melange-managed database. It is a presentation layer over calls the CLI already makes (GetDeployedModel, Checker.Explain, Checker.Expand); see specs/proposals/STUDIO.md. Two calls create objects in pg_temp inside a transaction that is always rolled back: what-if Explain (whatif.go), and Explain and Expand on a database migrated without their functions (sqlapi.Trace).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadOnlyDSN ¶
ReadOnlyDSN returns dsn with default_transaction_read_only=on set as a connection runtime parameter, so every statement the console runs is in a read-only transaction. Accepts URL and key=value forms.
func SetLatestRelease ¶
func SetLatestRelease(v string)
SetLatestRelease records a newer release ("0.9.7") for the top bar. The check runs in the CLI, server-side, so the page itself never calls out.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds the one database connection the console talks to.
func New ¶
New returns a Server over db. env is the active environment name, shown in the page header; empty means the base config. schemaPath may be empty.
func (*Server) SetExposure ¶ added in v0.11.0
SetExposure sets the configured SQL API exposure (the sql section of melange.yaml) that the Health page compares with the recorded one and predicts migrate with, as melange doctor does. Nil, the default, keeps the recorded one.