Help us shape the future of Go! Take the 2026 Go Developer Survey

sources

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Postgres types.DataSourceType = "postgres"
	DuckDB   types.DataSourceType = "duckdb"
	Http     types.DataSourceType = "http"
	Runtime  types.DataSourceType = "runtime"
)

Variables

View Source
var (
	ErrDataSourceNotFound                  = errors.New("data source not found")
	ErrDataSourceExists                    = errors.New("data source already exists")
	ErrDataSourceAttached                  = errors.New("data source is attached")
	ErrDataSourceNotAttached               = errors.New("data source is not attached")
	ErrUnknownDataSourceType               = errors.New("unknown data source type")
	ErrDataSourceAttachedWithDifferentType = errors.New("data source already attached with different type exists")
	ErrEmptyQuery                          = errors.New("empty query")
	ErrQueryParsingFailed                  = errors.New("query parsing failed")
)

Functions

func CheckDBExists

func CheckDBExists(ctx context.Context, db *db.Pool, name string, dsType types.DataSourceType) error

Types

type ParsedDSN

type ParsedDSN struct {
	Host     string
	Port     string
	User     string
	Password string
	DBName   string

	Params map[string]string
}

func ParseDSN

func ParseDSN(dsn string) (ParsedDSN, error)

type RuntimeSource

type RuntimeSource interface {
	Name() string
	Engine() engines.Engine
	IsReadonly() bool
	Attach(ctx context.Context, db *db.Pool) error
	Catalog(ctx context.Context) sources.Source
}

RuntimeSource is a data source that is attached on start and provides a catalog source.

type RuntimeSourceQuerier

type RuntimeSourceQuerier interface {
	QueryEngineSetup(querier *types.Querier)
}

type SelfDescriber

type SelfDescriber interface {
	CatalogSource(ctx context.Context, db *db.Pool) (sources.Source, error)
}

type Source

type Source interface {
	Name() string
	Definition() types.DataSource
	Engine() engines.Engine
	IsAttached() bool
	ReadOnly() bool
	Attach(ctx context.Context, db *db.Pool) error
	Detach(ctx context.Context, db *db.Pool) error
}

Directories

Path Synopsis
runtime

Jump to

Keyboard shortcuts

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