client

package
v0.0.0-...-308d61d Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

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, _ plugin.NewClientOptions) (plugin.Client, error)

Types

type Client

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

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.Record) 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.
	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 int `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 int `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

Jump to

Keyboard shortcuts

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