deploydb

package
v0.0.0-...-bf62912 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package deploydb resolves a database connection from a deployed blueprint instance's state so the CLI can run schema migrations against a deployed environment.

Resolution is provider-specific: how the concrete database and credential resources appear in state, and where credentials are fetched from, differ per cloud. Celerity is not AWS-only, so resolution is modular. A Resolver is selected by the deploy target (see ResolverFor), with one implementation per provider (aws.go today, with gcloud and azure to follow).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResolveInput

type ResolveInput struct {
	// SQLDatabaseName is the celerity/sqlDatabase resource's name in the
	// blueprint.
	SQLDatabaseName string

	// Engine is the database engine ("postgres", "mysql"), which determines the
	// shape of the connection string as well as the driver.
	Engine string

	// FallbackDatabase is the database name to use when deployed state does not
	// carry one.
	FallbackDatabase string
}

ResolveInput names the database to resolve a connection for.

type ResolvedConnection

type ResolvedConnection struct {
	// ConnectionString is the full connection URL (contains credentials).
	ConnectionString string
	// Target is a human-readable host/db summary, safe to print (no credentials).
	Target string
}

ResolvedConnection is a ready-to-use database connection derived from deployed state, with credentials already resolved from the provider's secret store.

type Resolver

type Resolver interface {
	Resolve(
		ctx context.Context,
		instance *state.InstanceState,
		input ResolveInput,
	) (*ResolvedConnection, error)
}

Resolver derives a database connection from deployed instance state for a particular deploy target's provider.

func ResolverFor

func ResolverFor(deployTarget string) (Resolver, error)

ResolverFor returns the connection resolver for a deploy target, or an error if that target's resolution is not supported yet.

Jump to

Keyboard shortcuts

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