database

package
v0.7.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MPL-2.0 Imports: 6 Imported by: 3 modules, 6 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

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 {
	schema.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