Documentation
¶
Index ¶
- type BigQueryDB
- func (db *BigQueryDB) Close() error
- func (db *BigQueryDB) Connect() error
- func (db *BigQueryDB) Exec(ctx context.Context, query string) error
- func (db *BigQueryDB) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
- func (db *BigQueryDB) ExtractData(table, outputFile, format string, batchSize int, ...) error
- func (db *BigQueryDB) GetColumns(table string) ([]string, error)
- func (db *BigQueryDB) GetTotalRows(table string) (int64, error)
- type Column
- type Config
- type Database
- func NewBigQuery(cfg *config.Config, stateManager state.Manager) (Database, error)
- func NewDatabase(dbType string, cfg *config.Config, stateManager state.Manager) (Database, error)
- func NewDatabricks(cfg *config.Config, stateManager state.Manager) (Database, error)
- func NewMSSQL(cfg *config.Config, stateManager state.Manager) (Database, error)
- func NewPostgres(cfg *config.Config, stateManager state.Manager) (Database, error)
- func NewSnowflake(cfg *config.Config, stateManager state.Manager) (Database, error)
- type DatabricksDB
- func (db *DatabricksDB) Close() error
- func (db *DatabricksDB) Connect() error
- func (db *DatabricksDB) Exec(ctx context.Context, query string) error
- func (db *DatabricksDB) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
- func (db *DatabricksDB) ExtractData(table, outputFile, format string, batchSize int, ...) error
- func (db *DatabricksDB) GetColumns(table string) ([]string, error)
- func (db *DatabricksDB) GetTotalRows(table string) (int64, error)
- type DuckDB
- func (db *DuckDB) Close() error
- func (db *DuckDB) Connect() error
- func (db *DuckDB) Exec(ctx context.Context, query string) error
- func (db *DuckDB) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
- func (db *DuckDB) ExtractData(table, outputFile, format string, batchSize int, ...) error
- func (db *DuckDB) GetColumns(table string) ([]string, error)
- func (db *DuckDB) GetRowCount(tableName string) (int64, error)
- func (db *DuckDB) GetTableSchema(tableName string) ([]Column, error)
- func (db *DuckDB) GetTotalRows(table string) (int64, error)
- type MSSQLDB
- func (db *MSSQLDB) Close() error
- func (db *MSSQLDB) Connect() error
- func (db *MSSQLDB) Exec(ctx context.Context, query string) error
- func (db *MSSQLDB) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
- func (db *MSSQLDB) ExtractData(table, outputFile, format string, batchSize int, ...) error
- func (db *MSSQLDB) GetColumns(table string) ([]string, error)
- func (db *MSSQLDB) GetTotalRows(table string) (int64, error)
- type PostgresDB
- func (db *PostgresDB) Close() error
- func (db *PostgresDB) Connect() error
- func (db *PostgresDB) Exec(ctx context.Context, query string) error
- func (db *PostgresDB) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
- func (db *PostgresDB) ExtractData(table, outputFile, format string, batchSize int, ...) error
- func (db *PostgresDB) GetColumns(table string) ([]string, error)
- func (db *PostgresDB) GetRowCount(tableName string) (int64, error)
- func (db *PostgresDB) GetTableSchema(tableName string) ([]Column, error)
- func (db *PostgresDB) GetTotalRows(table string) (int64, error)
- type SnowflakeDB
- func (db *SnowflakeDB) Close() error
- func (db *SnowflakeDB) Connect() error
- func (db *SnowflakeDB) Exec(ctx context.Context, query string) error
- func (db *SnowflakeDB) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
- func (db *SnowflakeDB) ExtractData(table, outputFile, format string, batchSize int, ...) error
- func (db *SnowflakeDB) GetColumns(table string) ([]string, error)
- func (db *SnowflakeDB) GetTotalRows(table string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BigQueryDB ¶
type BigQueryDB struct {
// contains filtered or unexported fields
}
func (*BigQueryDB) Close ¶
func (db *BigQueryDB) Close() error
func (*BigQueryDB) Connect ¶
func (db *BigQueryDB) Connect() error
func (*BigQueryDB) ExtractBatch ¶
func (*BigQueryDB) ExtractData ¶
func (db *BigQueryDB) ExtractData(table, outputFile, format string, batchSize int, keyColumns, whereClause string) error
func (*BigQueryDB) GetColumns ¶
func (db *BigQueryDB) GetColumns(table string) ([]string, error)
func (*BigQueryDB) GetTotalRows ¶
func (db *BigQueryDB) GetTotalRows(table string) (int64, error)
type Config ¶
type Config struct {
Type string
Host string
Port int
Username string
Password string
Database string
Schema string
ProjectID string
CredentialsFile string
Warehouse string
Catalog string
}
Config represents database configuration
type Database ¶
type Database interface {
// Connect establishes a connection to the database
Connect() error
// Close closes the database connection
Close() error
// ExtractData extracts data from a table and writes it to a file
ExtractData(table, outputFile, format string, batchSize int, keyColumns, whereClause string) error
// GetTotalRows returns the total number of rows in a table
GetTotalRows(table string) (int64, error)
// GetColumns returns the column names for a table
GetColumns(table string) ([]string, error)
// ExtractBatch extracts a batch of rows from a table
ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
// Exec executes a SQL query
Exec(ctx context.Context, query string) error
}
Database defines the interface for database operations
func NewBigQuery ¶
func NewDatabase ¶
NewDatabase creates a new database instance based on the type
func NewDatabricks ¶
func NewPostgres ¶
type DatabricksDB ¶
type DatabricksDB struct {
// contains filtered or unexported fields
}
func (*DatabricksDB) Close ¶
func (db *DatabricksDB) Close() error
func (*DatabricksDB) Connect ¶
func (db *DatabricksDB) Connect() error
func (*DatabricksDB) ExtractBatch ¶
func (*DatabricksDB) ExtractData ¶
func (db *DatabricksDB) ExtractData(table, outputFile, format string, batchSize int, keyColumns, whereClause string) error
func (*DatabricksDB) GetColumns ¶
func (db *DatabricksDB) GetColumns(table string) ([]string, error)
func (*DatabricksDB) GetTotalRows ¶
func (db *DatabricksDB) GetTotalRows(table string) (int64, error)
type DuckDB ¶
type DuckDB interface {
Database
}
DuckDB is the interface for DuckDB operations
func (*DuckDB) ExtractBatch ¶
func (*DuckDB) ExtractData ¶
func (*DuckDB) GetTableSchema ¶
type MSSQLDB ¶
type MSSQLDB struct {
// contains filtered or unexported fields
}
func (*MSSQLDB) ExtractBatch ¶
func (*MSSQLDB) ExtractData ¶
type PostgresDB ¶
type PostgresDB struct {
// contains filtered or unexported fields
}
func (*PostgresDB) Close ¶
func (db *PostgresDB) Close() error
func (*PostgresDB) Connect ¶
func (db *PostgresDB) Connect() error
func (*PostgresDB) ExtractBatch ¶
func (*PostgresDB) ExtractData ¶
func (db *PostgresDB) ExtractData(table, outputFile, format string, batchSize int, keyColumns, whereClause string) error
func (*PostgresDB) GetColumns ¶
func (db *PostgresDB) GetColumns(table string) ([]string, error)
func (*PostgresDB) GetRowCount ¶
func (db *PostgresDB) GetRowCount(tableName string) (int64, error)
func (*PostgresDB) GetTableSchema ¶
func (db *PostgresDB) GetTableSchema(tableName string) ([]Column, error)
func (*PostgresDB) GetTotalRows ¶
func (db *PostgresDB) GetTotalRows(table string) (int64, error)
type SnowflakeDB ¶
type SnowflakeDB struct {
// contains filtered or unexported fields
}
func (*SnowflakeDB) Close ¶
func (db *SnowflakeDB) Close() error
func (*SnowflakeDB) Connect ¶
func (db *SnowflakeDB) Connect() error
func (*SnowflakeDB) ExtractBatch ¶
func (*SnowflakeDB) ExtractData ¶
func (db *SnowflakeDB) ExtractData(table, outputFile, format string, batchSize int, keyColumns, whereClause string) error
func (*SnowflakeDB) GetColumns ¶
func (db *SnowflakeDB) GetColumns(table string) ([]string, error)
func (*SnowflakeDB) GetTotalRows ¶
func (db *SnowflakeDB) GetTotalRows(table string) (int64, error)
Click to show internal directories.
Click to hide internal directories.