Documentation
¶
Index ¶
- type BigQuery
- func (b *BigQuery) Close()
- func (b *BigQuery) Connect(ctx context.Context) error
- func (b *BigQuery) CreateDatabase() error
- func (b *BigQuery) DropDatabase() error
- func (b *BigQuery) Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (b *BigQuery) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
- func (b *BigQuery) GetColumns(table string) ([]string, error)
- func (b *BigQuery) GetPrimaryKey(ctx context.Context, table string) (string, error)
- func (b *BigQuery) GetTableSchema(tableName string) ([]Column, error)
- func (b *BigQuery) GetTotalRows(table string) (int64, error)
- func (b *BigQuery) Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
- type Column
- type Config
- type Database
- type Databricks
- func (d *Databricks) Close()
- func (d *Databricks) Connect(ctx context.Context) error
- func (d *Databricks) CreateDatabase() error
- func (d *Databricks) DropDatabase() error
- func (d *Databricks) Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (d *Databricks) ExtractBatch(ctx context.Context, table string, offset, limit int64) (Rows, error)
- func (d *Databricks) GetColumns(ctx context.Context, table string) ([]Column, error)
- func (d *Databricks) GetPrimaryKey(ctx context.Context, table string) (string, error)
- func (d *Databricks) GetTableSchema(tableName string) ([]Column, error)
- func (d *Databricks) GetTotalRows(ctx context.Context, table string) (int64, error)
- func (d *Databricks) Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
- type MSSQL
- func (m *MSSQL) Close()
- func (m *MSSQL) Connect(ctx context.Context) error
- func (m *MSSQL) CreateDatabase() error
- func (m *MSSQL) DropDatabase() error
- func (m *MSSQL) Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (m *MSSQL) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
- func (m *MSSQL) GetColumns(table string) ([]string, error)
- func (m *MSSQL) GetPrimaryKey(ctx context.Context, table string) (string, error)
- func (m *MSSQL) GetTableSchema(tableName string) ([]Column, error)
- func (m *MSSQL) GetTotalRows(table string) (int64, error)
- func (m *MSSQL) Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
- type PostgresDB
- func (p *PostgresDB) Close()
- func (p *PostgresDB) Connect(ctx context.Context) error
- func (p *PostgresDB) CreateDatabase() error
- func (p *PostgresDB) DB() *sql.DB
- func (p *PostgresDB) DropDatabase() error
- func (p *PostgresDB) Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (p *PostgresDB) ExtractBatch(ctx context.Context, table string, offset, limit int64) (Rows, error)
- func (p *PostgresDB) GetColumns(ctx context.Context, table string) ([]Column, error)
- func (p *PostgresDB) GetPrimaryKey(ctx context.Context, table string) (string, error)
- func (p *PostgresDB) GetTableSchema(tableName string) ([]Column, error)
- func (p *PostgresDB) GetTotalRows(ctx context.Context, table string) (int64, error)
- func (p *PostgresDB) Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
- type Result
- type Rows
- type Snowflake
- func (s *Snowflake) Close()
- func (s *Snowflake) Connect(ctx context.Context) error
- func (s *Snowflake) CreateDatabase() error
- func (s *Snowflake) DropDatabase() error
- func (s *Snowflake) Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (s *Snowflake) ExtractBatch(ctx context.Context, table string, offset, limit int64) (Rows, error)
- func (s *Snowflake) GetColumns(ctx context.Context, table string) ([]Column, error)
- func (s *Snowflake) GetPrimaryKey(ctx context.Context, table string) (string, error)
- func (s *Snowflake) GetTableSchema(tableName string) ([]Column, error)
- func (s *Snowflake) GetTotalRows(ctx context.Context, table string) (int64, error)
- func (s *Snowflake) Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BigQuery ¶
type BigQuery struct {
// contains filtered or unexported fields
}
BigQuery implements the Database interface for Google BigQuery
func NewBigQuery ¶
NewBigQuery creates a new BigQuery instance
func (*BigQuery) CreateDatabase ¶
CreateDatabase creates the database if it doesn't exist
func (*BigQuery) DropDatabase ¶
DropDatabase drops the database if it exists
func (*BigQuery) ExtractBatch ¶
func (b *BigQuery) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
ExtractBatch extracts a batch of rows from a table
func (*BigQuery) GetColumns ¶
GetColumns returns the columns of a table
func (*BigQuery) GetPrimaryKey ¶
GetPrimaryKey returns the primary key column of a table
func (*BigQuery) GetTableSchema ¶
GetTableSchema returns the schema of a table
func (*BigQuery) GetTotalRows ¶
GetTotalRows returns the total number of rows in a table
type Config ¶
type Config struct {
Host string
Port int
User string
Password string
DBName string
SSLMode string
}
Config holds database connection configuration
type Database ¶
type Database interface {
// Connect establishes a connection to the database
Connect(ctx context.Context) error
// Close closes the database connection
Close()
// GetTableSchema returns the schema of a table
GetTableSchema(tableName string) ([]Column, error)
// Query executes a query and returns the results
Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
// Exec executes a query without returning results
Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
// GetTotalRows returns the total number of rows in a table
GetTotalRows(ctx context.Context, table string) (int64, error)
// GetColumns returns the columns of a table
GetColumns(ctx context.Context, table string) ([]Column, error)
// ExtractBatch extracts a batch of rows from a table
ExtractBatch(ctx context.Context, table string, offset, limit int64) (Rows, error)
// GetPrimaryKey returns the primary key column of a table
GetPrimaryKey(ctx context.Context, table string) (string, error)
// CreateDatabase creates the database if it doesn't exist
CreateDatabase() error
// DropDatabase drops the database if it exists
DropDatabase() error
}
Database defines the interface for database operations
type Databricks ¶
type Databricks struct {
// contains filtered or unexported fields
}
Databricks implements the Database interface for Databricks
func NewDatabricks ¶
func NewDatabricks(config *Config) *Databricks
NewDatabricks creates a new Databricks instance
func (*Databricks) Connect ¶
func (d *Databricks) Connect(ctx context.Context) error
Connect establishes a connection to Databricks
func (*Databricks) CreateDatabase ¶
func (d *Databricks) CreateDatabase() error
CreateDatabase creates the database if it doesn't exist
func (*Databricks) DropDatabase ¶
func (d *Databricks) DropDatabase() error
DropDatabase drops the database if it exists
func (*Databricks) ExtractBatch ¶
func (d *Databricks) ExtractBatch(ctx context.Context, table string, offset, limit int64) (Rows, error)
ExtractBatch extracts a batch of rows from a table
func (*Databricks) GetColumns ¶
GetColumns returns the columns of a table
func (*Databricks) GetPrimaryKey ¶
GetPrimaryKey returns the primary key column of a table
func (*Databricks) GetTableSchema ¶
func (d *Databricks) GetTableSchema(tableName string) ([]Column, error)
GetTableSchema returns the schema of a table
func (*Databricks) GetTotalRows ¶
GetTotalRows returns the total number of rows in a table
type MSSQL ¶
type MSSQL struct {
// contains filtered or unexported fields
}
MSSQL implements the Database interface for Microsoft SQL Server
func (*MSSQL) CreateDatabase ¶
CreateDatabase creates the database if it doesn't exist
func (*MSSQL) DropDatabase ¶
DropDatabase drops the database if it exists
func (*MSSQL) ExtractBatch ¶
func (m *MSSQL) ExtractBatch(table string, offset, limit int64, keyColumns, whereClause string) ([]map[string]interface{}, error)
ExtractBatch extracts a batch of rows from a table
func (*MSSQL) GetColumns ¶
GetColumns returns the columns of a table
func (*MSSQL) GetPrimaryKey ¶
GetPrimaryKey returns the primary key column of a table
func (*MSSQL) GetTableSchema ¶
GetTableSchema returns the schema of a table
func (*MSSQL) GetTotalRows ¶
GetTotalRows returns the total number of rows in a table
type PostgresDB ¶
type PostgresDB struct {
// contains filtered or unexported fields
}
PostgresDB implements the Database interface for PostgreSQL
func NewPostgresDB ¶
func NewPostgresDB(config *Config) *PostgresDB
NewPostgresDB creates a new PostgreSQL database instance
func (*PostgresDB) Connect ¶
func (p *PostgresDB) Connect(ctx context.Context) error
Connect establishes a connection to the PostgreSQL database
func (*PostgresDB) CreateDatabase ¶
func (p *PostgresDB) CreateDatabase() error
CreateDatabase creates the database if it doesn't exist
func (*PostgresDB) DB ¶
func (p *PostgresDB) DB() *sql.DB
DB returns the underlying database connection
func (*PostgresDB) DropDatabase ¶
func (p *PostgresDB) DropDatabase() error
DropDatabase drops the database if it exists
func (*PostgresDB) ExtractBatch ¶
func (p *PostgresDB) ExtractBatch(ctx context.Context, table string, offset, limit int64) (Rows, error)
ExtractBatch extracts a batch of rows from a table
func (*PostgresDB) GetColumns ¶
GetColumns returns the columns of a table
func (*PostgresDB) GetPrimaryKey ¶
GetPrimaryKey returns the primary key column of a table
func (*PostgresDB) GetTableSchema ¶
func (p *PostgresDB) GetTableSchema(tableName string) ([]Column, error)
GetTableSchema returns the schema of a table
func (*PostgresDB) GetTotalRows ¶
GetTotalRows returns the total number of rows in a table
type Snowflake ¶
type Snowflake struct {
// contains filtered or unexported fields
}
Snowflake implements the Database interface for Snowflake
func NewSnowflake ¶
NewSnowflake creates a new Snowflake instance
func (*Snowflake) CreateDatabase ¶
CreateDatabase creates the database if it doesn't exist
func (*Snowflake) DropDatabase ¶
DropDatabase drops the database if it exists
func (*Snowflake) ExtractBatch ¶
func (s *Snowflake) ExtractBatch(ctx context.Context, table string, offset, limit int64) (Rows, error)
ExtractBatch extracts a batch of rows from a table
func (*Snowflake) GetColumns ¶
GetColumns returns the columns of a table
func (*Snowflake) GetPrimaryKey ¶
GetPrimaryKey returns the primary key column of a table
func (*Snowflake) GetTableSchema ¶
GetTableSchema returns the schema of a table
func (*Snowflake) GetTotalRows ¶
GetTotalRows returns the total number of rows in a table