db

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(driverName DriverName, dsn string) *Connection

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) Connect

func (c *Connection) Connect(ctx context.Context) (*sqlx.DB, error)

type DataLoader

type DataLoader struct {
	// contains filtered or unexported fields
}

func NewDataLoader

func NewDataLoader(conn *Connection) *DataLoader

func (*DataLoader) Load

func (l *DataLoader) Load(ctx context.Context, table string) (TableData, error)

type DriverName

type DriverName int
const (
	DriverNameUndefined DriverName = iota
	DriverNamePostgres
)

func CreateDriverName

func CreateDriverName(name string) (DriverName, error)

func (DriverName) String

func (n DriverName) String() string

type PGLoader

type PGLoader struct {
	// contains filtered or unexported fields
}

func NewPGLoader

func NewPGLoader(conn *Connection) *PGLoader

func (*PGLoader) Load

func (l *PGLoader) Load(ctx context.Context) (*schema.Schema, error)

type SchemaLoader

type SchemaLoader interface {
	// Load database schema
	Load(ctx context.Context) (*schema.Schema, error)
}

func CreateSchemaLoader

func CreateSchemaLoader(conn *Connection) (SchemaLoader, error)

type TableData

type TableData []map[string]interface{}

Jump to

Keyboard shortcuts

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