database

package
v0.14.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MPL-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDialectDSN

func ParseDialectDSN(inputDSN string) (d schema.DialectType, newDSN string, err error)

ParseDialectDSN parses a DSN and returns the suggested DialectType, as well as a new version of the DSN if applicable. The DSN change is done to support protocol-compatible databases without needing to add support for custom URL schemes to 3rd party packages.

Types

type DB

type DB struct {
	execution.Storage
	// contains filtered or unexported fields
}

DB encapsulates a schema.Storage and the (auto-detected) dialect it was configured with

func New

func New(ctx context.Context, logger hclog.Logger, dsn string) (*DB, error)

New creates a new DB using the provided DSN. It will auto-detect the dialect based on the DSN and pass that info to NewPgDatabase

func (*DB) DialectType

func (d *DB) DialectType() schema.DialectType

DialectType returns the dialect type the DB was configured with

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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