client

package
v5.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MPL-2.0 Imports: 23 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSONSchema string

Functions

func New

func New(ctx context.Context, logger zerolog.Logger, spec []byte, opts plugin.NewClientOptions) (plugin.Client, error)

Types

type Client

type Client struct {
	plugin.UnimplementedSource
	batchwriter.UnimplementedDeleteRecord
	// contains filtered or unexported fields
}

func (*Client) AssessTables added in v5.7.0

func (c *Client) AssessTables(_ context.Context, tables []plugin.TablePair, _ plugin.AssessOptions) ([]plugin.TableFinding, error)

func (*Client) Close

func (c *Client) Close(ctx context.Context) error

func (*Client) DeleteStale

func (c *Client) DeleteStale(ctx context.Context, msgs message.WriteDeleteStales) error

func (*Client) MigrateTables

func (c *Client) MigrateTables(ctx context.Context, msgs message.WriteMigrateTables) error

Migrate relies on the CLI/client to lock before running migration.

func (*Client) Read

func (c *Client) Read(ctx context.Context, table *schema.Table, res chan<- arrow.RecordBatch) error

func (*Client) Write

func (c *Client) Write(ctx context.Context, res <-chan message.WriteMessage) error

func (*Client) WriteTableBatch

func (c *Client) WriteTableBatch(ctx context.Context, name string, msgs message.WriteInserts) error

type ServerType

type ServerType int64
const (
	ServerTypeMySQL   ServerType = 0
	ServerTypeMariaDB ServerType = 1
)

type Spec

type Spec struct {
	// Connection string to connect to the database. See the [Go driver documentation](https://github.com/go-sql-driver/mysql#dsn-data-source-name) for details.
	//
	// - `"user:password@tcp(127.0.0.1:3306)/dbname"` connect with TCP
	// - `"user:password@127.0.0.1:3306/dbname?charset=utf8mb4&parseTime=True&loc=Local"` connect and set charset, time parsing, and location
	// - `"user:password@localhost:3306/dbname?timeout=30s&readTimeout=1s&writeTimeout=1s"` connect and set various timeouts
	// - `"user:password@/dbname?loc=UTC&allowNativePasswords=true&tls=preferred"` connect and set location and native password allowance, and prefer TLS
	ConnectionString string `json:"connection_string" jsonschema:"required,minLength=1"`

	// Maximum number of items that may be grouped together to be written in a single write.
	BatchSize int64 `json:"batch_size,omitempty" jsonschema:"minimum=1,default=1000"`

	// Maximum size of items that may be grouped together to be written in a single write.
	BatchSizeBytes int64 `json:"batch_size_bytes,omitempty" jsonschema:"minimum=1,default=4194304"`
}

func (*Spec) SetDefaults

func (s *Spec) SetDefaults()

func (Spec) Validate

func (s Spec) Validate() error

Directories

Path Synopsis
spec
gen command

Jump to

Keyboard shortcuts

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