database

package
v0.0.0-...-b8497f2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConnector

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

func NewBaseConnector

func NewBaseConnector(cfg Config) *BaseConnector

func (*BaseConnector) Close

func (c *BaseConnector) Close() error

func (*BaseConnector) Ping

func (c *BaseConnector) Ping(ctx context.Context) error

type ClickHouseConnector

type ClickHouseConnector struct {
	*BaseConnector
	// contains filtered or unexported fields
}

func NewClickHouseConnector

func NewClickHouseConnector(cfg Config) (*ClickHouseConnector, error)

func (*ClickHouseConnector) Close

func (c *ClickHouseConnector) Close() error

func (*ClickHouseConnector) Ping

func (*ClickHouseConnector) Query

func (c *ClickHouseConnector) Query(ctx context.Context, query string, args ...interface{}) (Rows, error)

type ClickHouseSchemaLoader

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

ClickHouseSchemaLoader is a schema loader for ClickHouse databases.

func NewClickHouseSchemaLoader

func NewClickHouseSchemaLoader(db *sql.DB) *ClickHouseSchemaLoader

NewClickHouseSchemaLoader creates a new ClickHouseSchemaLoader.

func (*ClickHouseSchemaLoader) LoadSchema

func (l *ClickHouseSchemaLoader) LoadSchema(ctx context.Context, schema *models.DatabaseSchema) error

LoadSchema loads a schema into a ClickHouse database.

type Config

type Config struct {
	Driver                     string // mysql / clickhouse / starrocks
	Host                       string
	Port                       int
	User, Password, Database   string
	MaxOpenConns, MaxIdleConns int
	ConnTimeout                time.Duration
}

type Connector

type Connector interface {
	Ping(ctx context.Context) error
	Query(ctx context.Context, sql string, args ...interface{}) (Rows, error)
	Close() error
}

type DBExecutionService

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

DBExecutionService is an implementation of the execution service that runs benchmarks against a real database.

func NewDBExecutionService

func NewDBExecutionService(driver, dsn string, rc services.RateController) (*DBExecutionService, error)

NewDBExecutionService creates a new DBExecutionService.

func (*DBExecutionService) RunBench

RunBench executes a benchmark workload against the database.

type MySQLConnector

type MySQLConnector struct {
	*BaseConnector
	// contains filtered or unexported fields
}

func NewMySQLConnector

func NewMySQLConnector(cfg Config) (*MySQLConnector, error)

func (*MySQLConnector) Close

func (c *MySQLConnector) Close() error

func (*MySQLConnector) Ping

func (c *MySQLConnector) Ping(_ context.Context) error

func (*MySQLConnector) Query

func (c *MySQLConnector) Query(_ context.Context, sql string, args ...interface{}) (Rows, error)

type MySqlSchemaExtractor

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

MySqlSchemaExtractor is a schema extractor for MySQL databases.

func NewMySqlSchemaExtractor

func NewMySqlSchemaExtractor(db *sql.DB) *MySqlSchemaExtractor

NewMySqlSchemaExtractor creates a new MySqlSchemaExtractor.

func (*MySqlSchemaExtractor) ExtractSchema

func (e *MySqlSchemaExtractor) ExtractSchema(ctx context.Context) (*models.DatabaseSchema, error)

ExtractSchema extracts the schema from a MySQL database.

type MySqlSchemaLoader

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

MySqlSchemaLoader is a schema loader for MySQL databases.

func NewMySqlSchemaLoader

func NewMySqlSchemaLoader(db *sql.DB) *MySqlSchemaLoader

NewMySqlSchemaLoader creates a new MySqlSchemaLoader.

func (*MySqlSchemaLoader) LoadSchema

func (l *MySqlSchemaLoader) LoadSchema(ctx context.Context, schema *models.DatabaseSchema) error

LoadSchema loads a schema into a MySQL database.

type PostgresSchemaExtractor

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

PostgresSchemaExtractor is a schema extractor for PostgreSQL databases.

func NewPostgresSchemaExtractor

func NewPostgresSchemaExtractor(db *sql.DB) *PostgresSchemaExtractor

NewPostgresSchemaExtractor creates a new PostgresSchemaExtractor.

func (*PostgresSchemaExtractor) ExtractSchema

ExtractSchema extracts the schema from a PostgreSQL database.

type PostgresSchemaLoader

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

PostgresSchemaLoader is a schema loader for PostgreSQL databases.

func NewPostgresSchemaLoader

func NewPostgresSchemaLoader(db *sql.DB) *PostgresSchemaLoader

NewPostgresSchemaLoader creates a new PostgresSchemaLoader.

func (*PostgresSchemaLoader) LoadSchema

func (l *PostgresSchemaLoader) LoadSchema(ctx context.Context, schema *models.DatabaseSchema) error

LoadSchema loads a schema into a PostgreSQL database.

type Rows

type Rows interface {
	Close() error
	Next() bool
	Scan(dest ...interface{}) error
}

Jump to

Keyboard shortcuts

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