providers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package providers is the single source of truth for which database drivers GoForge supports: their canonical name (as stored in goforge.yaml), accepted aliases, human label, and an example DSN with CHANGE_* placeholders so a project's .env can be scaffolded without anyone having to look up the driver's connection string syntax.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Names

func Names() []string

Names returns the canonical driver names, for help text and error messages.

Types

type Descriptor

type Descriptor struct {
	// Driver is the canonical name stored in goforge.yaml's database.driver
	// and used internally once resolved (see Resolve).
	Driver string
	// Label is the human-readable name shown in CLI output.
	Label string
	// Aliases are other spellings --driver accepts for this Descriptor.
	Aliases []string
	// ExampleDSN is a template DSN with CHANGE_* placeholders, in the exact
	// syntax this driver expects, so a generated .env is immediately
	// editable without consulting external documentation.
	ExampleDSN string
	// VersionQuery returns the connected server's own version string.
	VersionQuery string
	// CurrentDatabaseQuery returns the name of the connected database.
	CurrentDatabaseQuery string
}

Descriptor describes one supported database provider.

func List

func List() []Descriptor

List returns every supported provider, in a stable order.

func Resolve

func Resolve(driver string) (Descriptor, error)

Resolve normalizes a --driver/database.driver value (case-insensitively, accepting aliases) to its canonical Descriptor.

Jump to

Keyboard shortcuts

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