drivers

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factories = map[string]DBconnectionFactory{
	"duckdb":   InitDuckDBEnginFactory(),
	"postgres": InitPostgresDBEnginFactory(),
}

Functions

func RegisterConnectionFactory

func RegisterConnectionFactory(driverName string, f DBconnectionFactory)

This method can be used to register a custom database engine

A custom database engine must implement the drivers.DBDriver interface

Types

type DBDriver

type DBDriver interface {
	Connect() error
	Begin() (interface{}, error)
	Commit(tx interface{}) error
	Rallback(tx interface{}) error
	Close() error
	Exec(tx interface{}, sql string) error
	ToDataFrame(sql string) (*dataframe.DataFrame, error)
	PersistDataFrame(tx interface{}, name string, df *dataframe.DataFrame) error
	GetListOfFields(tx interface{}, tableName string) []string
	CheckTableExists(tx interface{}, tableName string) bool
	CheckSchemaExists(tx interface{}, schemaName string) bool
	GetRawConnection() interface{}
	SimpleTest(sql string) (string, error)
	ConcurrencyLock()
	ConcurrencyUnlock()
}

func EstablishDBConnection

func EstablishDBConnection(connection *configs.DBConnectionConfig) (DBDriver, error)

type DBconnectionFactory

type DBconnectionFactory interface {
	CreateConnection(connection configs.DBConnectionConfig) (DBDriver, error)
}

func InitDuckDBEnginFactory

func InitDuckDBEnginFactory() DBconnectionFactory

func InitPostgresDBEnginFactory added in v0.2.0

func InitPostgresDBEnginFactory() DBconnectionFactory

type DuckDBEngine

type DuckDBEngine struct {
	Mutex *sync.Mutex
	// contains filtered or unexported fields
}

func (*DuckDBEngine) Begin

func (d *DuckDBEngine) Begin() (interface{}, error)

Begin implements DBEngine.

func (*DuckDBEngine) CheckSchemaExists

func (d *DuckDBEngine) CheckSchemaExists(tx interface{}, tableName string) bool

CheckSchemaExists implements DBEngine.

func (*DuckDBEngine) CheckTableExists

func (d *DuckDBEngine) CheckTableExists(tx interface{}, tableName string) bool

CheckTableExists implements DBEngine.

func (*DuckDBEngine) Close

func (d *DuckDBEngine) Close() error

Close implements DBEngine.

func (*DuckDBEngine) Commit

func (d *DuckDBEngine) Commit(tx interface{}) error

Commit implements DBEngine.

func (*DuckDBEngine) ConcurrencyLock added in v0.2.0

func (d *DuckDBEngine) ConcurrencyLock()

func (*DuckDBEngine) ConcurrencyUnlock added in v0.2.0

func (d *DuckDBEngine) ConcurrencyUnlock()

func (*DuckDBEngine) Connect

func (d *DuckDBEngine) Connect() error

Connect implements DBEngine.

func (*DuckDBEngine) Exec

func (d *DuckDBEngine) Exec(tx interface{}, sqlQuery string) error

Exec implements DBEngine.

func (*DuckDBEngine) GetListOfFields

func (d *DuckDBEngine) GetListOfFields(tx interface{}, tableName string) []string

GetListOfFields implements DBEngine.

func (*DuckDBEngine) GetRawConnection added in v0.1.2

func (d *DuckDBEngine) GetRawConnection() interface{}

func (*DuckDBEngine) PersistDataFrame added in v0.1.2

func (d *DuckDBEngine) PersistDataFrame(tx interface{}, name string, df *dataframe.DataFrame) error

func (*DuckDBEngine) Rallback

func (d *DuckDBEngine) Rallback(tx interface{}) error

Rallback implements DBEngine.

func (*DuckDBEngine) SimpleTest added in v0.1.3

func (d *DuckDBEngine) SimpleTest(sqlQuery string) (string, error)

func (*DuckDBEngine) ToDataFrame added in v0.1.2

func (d *DuckDBEngine) ToDataFrame(sqlQuery string) (*dataframe.DataFrame, error)

ToDataFrame implements DBDriver.

type DuckDBEngineFactory

type DuckDBEngineFactory struct {
}

func (*DuckDBEngineFactory) CreateConnection

func (d *DuckDBEngineFactory) CreateConnection(connection configs.DBConnectionConfig) (DBDriver, error)

CreateConnection implements DBconnectionFactory.

type PostgresDBEngine added in v0.2.0

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

func (*PostgresDBEngine) Begin added in v0.2.0

func (d *PostgresDBEngine) Begin() (interface{}, error)

Begin implements DBEngine.

func (*PostgresDBEngine) CheckSchemaExists added in v0.2.0

func (d *PostgresDBEngine) CheckSchemaExists(tx interface{}, tableName string) bool

CheckSchemaExists implements DBEngine.

func (*PostgresDBEngine) CheckTableExists added in v0.2.0

func (d *PostgresDBEngine) CheckTableExists(tx interface{}, tableName string) bool

CheckTableExists implements DBEngine.

func (*PostgresDBEngine) Close added in v0.2.0

func (d *PostgresDBEngine) Close() error

Close implements DBEngine.

func (*PostgresDBEngine) Commit added in v0.2.0

func (d *PostgresDBEngine) Commit(tx interface{}) error

Commit implements DBEngine.

func (*PostgresDBEngine) ConcurrencyLock added in v0.2.0

func (d *PostgresDBEngine) ConcurrencyLock()

func (*PostgresDBEngine) ConcurrencyUnlock added in v0.2.0

func (d *PostgresDBEngine) ConcurrencyUnlock()

func (*PostgresDBEngine) Connect added in v0.2.0

func (d *PostgresDBEngine) Connect() error

Connect implements DBEngine.

func (*PostgresDBEngine) Exec added in v0.2.0

func (d *PostgresDBEngine) Exec(tx interface{}, sqlQuery string) error

Exec implements DBEngine.

func (*PostgresDBEngine) GetListOfFields added in v0.2.0

func (d *PostgresDBEngine) GetListOfFields(tx interface{}, tableName string) []string

GetListOfFields implements DBEngine.

func (*PostgresDBEngine) GetRawConnection added in v0.2.0

func (d *PostgresDBEngine) GetRawConnection() interface{}

func (*PostgresDBEngine) PersistDataFrame added in v0.2.0

func (d *PostgresDBEngine) PersistDataFrame(tx interface{}, name string, df *dataframe.DataFrame) error

PersistDataFrame implements PGDriver.

func (*PostgresDBEngine) Rallback added in v0.2.0

func (d *PostgresDBEngine) Rallback(tx interface{}) error

Rallback implements DBEngine.

func (*PostgresDBEngine) SimpleTest added in v0.2.0

func (d *PostgresDBEngine) SimpleTest(sqlQuery string) (string, error)

func (*PostgresDBEngine) ToDataFrame added in v0.2.0

func (d *PostgresDBEngine) ToDataFrame(sqlQuery string) (*dataframe.DataFrame, error)

ToDataFrame implements PGDriver.

type PostgresDBEngineFactory added in v0.2.0

type PostgresDBEngineFactory struct {
}

func (*PostgresDBEngineFactory) CreateConnection added in v0.2.0

func (d *PostgresDBEngineFactory) CreateConnection(connection configs.DBConnectionConfig) (DBDriver, error)

CreateConnection implements DBconnectionFactory.

Jump to

Keyboard shortcuts

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