sqlalchemy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidDatabaseURL means invalid as a SQLAlchemy's Engine URL format.
	ErrInvalidDatabaseURL = errors.New("invalid database url")
	// ErrUnsupportedDialect means the given dialect is unsupported.
	ErrUnsupportedDialect = errors.New("unsupported dialect")
)

Functions

func GetGormDBFromURL

func GetGormDBFromURL(url string, opt *EngineOption) (*gorm.DB, error)

GetGormDBFromURL parse SQLAlchemy's Engine URL format and returns GORM v2 DB object.

func ParseDatabaseURL

func ParseDatabaseURL(url string, opt *EngineOption) (string, string, error)

ParseDatabaseURL parse SQLAlchemy's Engine URL format and returns Go's dialect and args.

Types

type EngineOption

type EngineOption struct {
	ParseTime bool
}

EngineOption to set the DSN option

Jump to

Keyboard shortcuts

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