client

package
v0.0.0-...-424f6f9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSONSchema string

Functions

func New

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

func (*Client) Read

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

func (*Client) SchemaTypeToSnowflake

func (*Client) SchemaTypeToSnowflake(t arrow.DataType) string

func (*Client) Write

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

func (*Client) WriteTableBatch

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

type Spec

type Spec struct {
	// Snowflake `connection_string`.
	ConnectionString string `json:"connection_string" jsonschema:"required,minLength=1"`

	// A PEM-encoded private key for connecting to snowflake. Equivalent to adding
	//  `authenticator=snowflake_jwt&privateKey=...` to the `connection_string` but
	//  parses, validates, and correctly encodes the key for use with snowflake.
	PrivateKey string `json:"private_key,omitempty"`

	// Number of records to batch together before sending to the database.
	BatchSize int `json:"batch_size,omitempty" jsonschema:"minimum=1,default=1000"`

	// Number of bytes (as Arrow buffer size) to batch together before sending to the database.
	BatchSizeBytes int `json:"batch_size_bytes,omitempty" jsonschema:"minimum=1,default=4194304"`

	// By default, tables are migrated one at a time.
	// This option allows you to migrate multiple tables concurrently.
	// This can be useful if you have a lot of tables to migrate and want to speed up the process.
	MigrateConcurrency int `json:"migrate_concurrency,omitempty" jsonschema:"minimum=1,default=1"`

	// If set to true, intermediary files used to load data to the Snowflake stage are left in the temp directory. This can be useful for debugging purposes.
	LeaveStageFiles bool `json:"leave_stage_files,omitempty" jsonschema:"default=false"`
}

func (Spec) DSN

func (s Spec) DSN() (string, error)

func (*Spec) SetDefaults

func (s *Spec) SetDefaults()

Directories

Path Synopsis
spec
gen

Jump to

Keyboard shortcuts

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