Documentation
¶
Index ¶
- Variables
- func New(ctx context.Context, logger zerolog.Logger, spec []byte, ...) (plugin.Client, error)
- func NewConnectionTester(...) plugin.ConnectionTester
- type Client
- func (c *Client) Close(ctx context.Context) error
- func (c *Client) DeleteStale(ctx context.Context, msgs message.WriteDeleteStales) error
- func (c *Client) MigrateTables(ctx context.Context, msgs message.WriteMigrateTables) error
- func (c *Client) Read(ctx context.Context, table *schema.Table, res chan<- arrow.RecordBatch) error
- func (c *Client) Write(ctx context.Context, res <-chan message.WriteMessage) error
- func (c *Client) WriteTableBatch(ctx context.Context, name string, msgs message.WriteInserts) error
- type ServerType
- type Spec
Constants ¶
This section is empty.
Variables ¶
View Source
var JSONSchema string
Functions ¶
func NewConnectionTester ¶
Types ¶
type Client ¶
type Client struct {
plugin.UnimplementedSource
batchwriter.UnimplementedDeleteRecord
// contains filtered or unexported fields
}
func (*Client) DeleteStale ¶
func (*Client) MigrateTables ¶
Migrate relies on the CLI/client to lock before running migration.
func (*Client) WriteTableBatch ¶
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()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.