connections

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package connections resolves named commons-db connections, kept as typed Connection resources in the commons-db connection store, into database DSNs.

Index

Constants

View Source
const App = "sqlglot-go"

App names sqlglot's own connection layer, <config>/sqlglot-go/connections.

View Source
const KubeContextProperty = dbcontext.KubeContextProperty

KubeContextProperty selects the kubeconfig context used to read the connection's secret:// and configmap:// references.

View Source
const Prefix = "connection://"

Prefix marks a --dsn value as a named connection reference.

Variables

SQLTypes are the connection types sqlglot can open.

Functions

func DefaultDir

func DefaultDir() string

DefaultDir is sqlglot's own layer: $XDG_CONFIG_HOME/sqlglot-go/connections, otherwise ~/.config/sqlglot-go/connections.

func Open

func Open(dir string) (*store.Store, error)

Open is the connection store: the connections every Flanksource tool shares, then dir as sqlglot's own layer (DefaultDir when empty), then ./.connections, each overriding the one before.

func Resolve

func Resolve(ctx context.Context, opts ResolveOptions) (string, error)

Resolve hydrates a connection://[<namespace>/]<name> reference and returns its templated URL as a DSN.

Types

type ResolveOptions

type ResolveOptions struct {
	Dir       string
	Reference string
	// Kubernetes is the client for references of a connection without a
	// kubecontext property; one with that property uses its own context.
	Kubernetes *dutyKubernetes.Client
}

Jump to

Keyboard shortcuts

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