Documentation
¶
Index ¶
- Variables
- func RegisterConnectionFactory(driverName string, f DBconnectionFactory)
- type DBDriver
- type DBconnectionFactory
- type DuckDBEngine
- func (d *DuckDBEngine) Begin() (interface{}, error)
- func (d *DuckDBEngine) CheckSchemaExists(tx interface{}, tableName string) bool
- func (d *DuckDBEngine) CheckTableExists(tx interface{}, tableName string) bool
- func (d *DuckDBEngine) Close() error
- func (d *DuckDBEngine) Commit(tx interface{}) error
- func (d *DuckDBEngine) ConcurrencyLock()
- func (d *DuckDBEngine) ConcurrencyUnlock()
- func (d *DuckDBEngine) Connect() error
- func (d *DuckDBEngine) Exec(tx interface{}, sqlQuery string) error
- func (d *DuckDBEngine) GetListOfFields(tx interface{}, tableName string) []string
- func (d *DuckDBEngine) GetRawConnection() interface{}
- func (d *DuckDBEngine) PersistDataFrame(tx interface{}, name string, df *dataframe.DataFrame) error
- func (d *DuckDBEngine) Rallback(tx interface{}) error
- func (d *DuckDBEngine) SimpleTest(sqlQuery string) (string, error)
- func (d *DuckDBEngine) ToDataFrame(sqlQuery string) (*dataframe.DataFrame, error)
- type DuckDBEngineFactory
- type PostgresDBEngine
- func (d *PostgresDBEngine) Begin() (interface{}, error)
- func (d *PostgresDBEngine) CheckSchemaExists(tx interface{}, tableName string) bool
- func (d *PostgresDBEngine) CheckTableExists(tx interface{}, tableName string) bool
- func (d *PostgresDBEngine) Close() error
- func (d *PostgresDBEngine) Commit(tx interface{}) error
- func (d *PostgresDBEngine) ConcurrencyLock()
- func (d *PostgresDBEngine) ConcurrencyUnlock()
- func (d *PostgresDBEngine) Connect() error
- func (d *PostgresDBEngine) Exec(tx interface{}, sqlQuery string) error
- func (d *PostgresDBEngine) GetListOfFields(tx interface{}, tableName string) []string
- func (d *PostgresDBEngine) GetRawConnection() interface{}
- func (d *PostgresDBEngine) PersistDataFrame(tx interface{}, name string, df *dataframe.DataFrame) error
- func (d *PostgresDBEngine) Rallback(tx interface{}) error
- func (d *PostgresDBEngine) SimpleTest(sqlQuery string) (string, error)
- func (d *PostgresDBEngine) ToDataFrame(sqlQuery string) (*dataframe.DataFrame, error)
- type PostgresDBEngineFactory
Constants ¶
This section is empty.
Variables ¶
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 ¶
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) 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) 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.