studio

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

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.

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadOnlyDSN

func ReadOnlyDSN(dsn string) (string, error)

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.

func VerifyReadOnly

func VerifyReadOnly(ctx context.Context, db *sql.DB) error

VerifyReadOnly fails unless the connection really is read-only, so a driver that ignored the runtime parameter cannot silently leave writes enabled.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server holds the one database connection the console talks to.

func New

func New(db *sql.DB, dbSchema, env, schemaPath string) *Server

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) Handler

func (s *Server) Handler() http.Handler

Handler returns the console's routes, wrapped in a Host check.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL