Help us shape the future of Go! Take the 2026 Go Developer Survey

mssql

package
v0.11.783 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewColumnCheckOperator

func NewColumnCheckOperator(manager config.ConnectionGetter) *ansisql.ColumnCheckOperator

func NewMaterializer

func NewMaterializer(fullRefresh bool) *pipeline.Materializer

func QuoteIdentifier added in v0.11.354

func QuoteIdentifier(identifier string) string

QuoteIdentifier quotes a SQL Server identifier (table, column, etc.) to handle special characters. It splits the identifier on "." and quotes each part separately with square brackets. For example, "schema.my-table" becomes "[schema].[my-table]".

Types

type AcceptedValuesCheck

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

func (*AcceptedValuesCheck) Check

type BasicOperator

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

func NewBasicOperator

func NewBasicOperator(conn config.ConnectionGetter, extractor query.QueryExtractor, materializer materializer, parser *sqlparser.SQLParser) *BasicOperator

func (BasicOperator) Run

func (BasicOperator) RunTask

type Config

type Config struct {
	Username string
	Password string
	Host     string
	Port     int
	Database string
	Query    string
}

func (*Config) GetIngestrURI added in v0.7.0

func (c *Config) GetIngestrURI() string

func (*Config) ToDBConnectionURI

func (c *Config) ToDBConnectionURI() string

type DB

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

func NewDB

func NewDB(c *Config) (*DB, error)

func (*DB) BuildTableExistsQuery added in v0.11.296

func (db *DB) BuildTableExistsQuery(tableName string) (string, error)

func (*DB) GetColumns added in v0.11.247

func (db *DB) GetColumns(ctx context.Context, databaseName, tableName string) ([]*ansisql.DBColumn, error)

func (*DB) GetDatabaseSummary added in v0.11.260

func (db *DB) GetDatabaseSummary(ctx context.Context) (*ansisql.DBDatabase, error)

func (*DB) GetDatabases added in v0.11.247

func (db *DB) GetDatabases(ctx context.Context) ([]string, error)

func (*DB) GetIngestrURI added in v0.7.0

func (db *DB) GetIngestrURI() (string, error)

func (*DB) GetTables added in v0.11.247

func (db *DB) GetTables(ctx context.Context, databaseName string) ([]string, error)

func (*DB) Limit added in v0.11.144

func (db *DB) Limit(q string, limit int64) string

Limit wraps the query so it returns at most `limit` rows. Queries that begin with a CTE are limited via an appended CTE rather than a derived-table wrapper, since T-SQL forbids a WITH clause inside a derived table (which would otherwise fail with "Incorrect syntax near ')'").

func (*DB) Ping added in v0.11.274

func (db *DB) Ping(ctx context.Context) error

func (*DB) RunQueryWithoutResult

func (db *DB) RunQueryWithoutResult(ctx context.Context, query *query.Query) error

func (*DB) Select

func (db *DB) Select(ctx context.Context, query *query.Query) ([][]interface{}, error)

func (*DB) SelectWithSchema added in v0.11.274

func (db *DB) SelectWithSchema(ctx context.Context, queryObj *query.Query) (*query.QueryResult, error)

type Limiter added in v0.11.144

type Limiter interface {
	Limit(query string, limit int64) string
}

type MsClient

type MsClient interface {
	RunQueryWithoutResult(ctx context.Context, query *query.Query) error
	Select(ctx context.Context, query *query.Query) ([][]interface{}, error)
}

type PatternCheck added in v0.10.1

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

func (*PatternCheck) Check added in v0.10.1

type UniqueCheck added in v0.11.23

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

func NewUniqueCheck added in v0.11.23

func NewUniqueCheck(conn config.ConnectionGetter) *UniqueCheck

func (*UniqueCheck) Check added in v0.11.23

Jump to

Keyboard shortcuts

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