sql

package
v0.39.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2019 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ToSQLKind = "toSQL"
	BatchSize = 10000
)
View Source
const FromSQLKind = "fromSQL"

Variables

This section is empty.

Functions

func CreateInsertComponents added in v0.35.0

func CreateInsertComponents(t *ToSQLTransformation, tbl flux.Table) (colNames []string, valStringArray [][]string, valArgsArray [][]interface{}, err error)

func ExecuteQueries added in v0.35.0

func ExecuteQueries(tx *sql.Tx, s *ToSQLOpSpec, colNames []string, valueStrings *[]string, valueArgs *[]interface{}) (err error)

func NewMySQLRowReader added in v0.34.1

func NewMySQLRowReader(r *sql.Rows) (execute.RowReader, error)

func NewPostgresRowReader added in v0.34.1

func NewPostgresRowReader(r *sql.Rows) (execute.RowReader, error)

func UInt8ToFloat added in v0.34.1

func UInt8ToFloat(a []uint8) (float64, error)

func UInt8ToInt64 added in v0.34.1

func UInt8ToInt64(a []uint8) (int64, error)

Types

type FromSQLOpSpec

type FromSQLOpSpec struct {
	DriverName     string `json:"driverName,omitempty"`
	DataSourceName string `json:"dataSourceName,omitempty"`
	Query          string `json:"query,omitempty"`
}

func (*FromSQLOpSpec) Kind

func (s *FromSQLOpSpec) Kind() flux.OperationKind

type FromSQLProcedureSpec

type FromSQLProcedureSpec struct {
	plan.DefaultCost
	DriverName     string
	DataSourceName string
	Query          string
}

func (*FromSQLProcedureSpec) Copy

func (*FromSQLProcedureSpec) Kind

type MySQLRowReader added in v0.34.1

type MySQLRowReader struct {
	Cursor *sql.Rows

	NextFunc func() bool
	// contains filtered or unexported fields
}

func (*MySQLRowReader) ColumnNames added in v0.34.1

func (m *MySQLRowReader) ColumnNames() []string

func (*MySQLRowReader) ColumnTypes added in v0.34.1

func (m *MySQLRowReader) ColumnTypes() []flux.ColType

func (*MySQLRowReader) GetNextRow added in v0.34.1

func (m *MySQLRowReader) GetNextRow() ([]values.Value, error)

func (*MySQLRowReader) InitColumnNames added in v0.34.1

func (m *MySQLRowReader) InitColumnNames(names []string)

func (*MySQLRowReader) InitColumnTypes added in v0.34.1

func (m *MySQLRowReader) InitColumnTypes(types []*sql.ColumnType)

func (*MySQLRowReader) Next added in v0.34.1

func (m *MySQLRowReader) Next() bool

Prepares MySQLRowReader to return rows

func (*MySQLRowReader) SetColumnTypes added in v0.34.1

func (m *MySQLRowReader) SetColumnTypes(types []flux.ColType)

func (*MySQLRowReader) SetColumns added in v0.34.1

func (m *MySQLRowReader) SetColumns(i []interface{})

type PostgresRowReader added in v0.34.1

type PostgresRowReader struct {
	Cursor *sql.Rows
	// contains filtered or unexported fields
}

func (*PostgresRowReader) ColumnNames added in v0.34.1

func (m *PostgresRowReader) ColumnNames() []string

func (*PostgresRowReader) ColumnTypes added in v0.34.1

func (m *PostgresRowReader) ColumnTypes() []flux.ColType

func (*PostgresRowReader) GetNextRow added in v0.34.1

func (m *PostgresRowReader) GetNextRow() ([]values.Value, error)

func (*PostgresRowReader) InitColumnNames added in v0.34.1

func (m *PostgresRowReader) InitColumnNames(n []string)

func (*PostgresRowReader) InitColumnTypes added in v0.34.1

func (m *PostgresRowReader) InitColumnTypes(types []*sql.ColumnType)

func (*PostgresRowReader) Next added in v0.34.1

func (m *PostgresRowReader) Next() bool

func (*PostgresRowReader) SetColumns added in v0.34.1

func (m *PostgresRowReader) SetColumns(i []interface{})

type SQLIterator

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

func (*SQLIterator) Close added in v0.18.0

func (c *SQLIterator) Close() error

func (*SQLIterator) Connect

func (c *SQLIterator) Connect(ctx context.Context) error

func (*SQLIterator) Decode

func (c *SQLIterator) Decode(ctx context.Context) (flux.Table, error)

func (*SQLIterator) Fetch

func (c *SQLIterator) Fetch(ctx context.Context) (bool, error)

type ToSQLOpSpec added in v0.35.0

type ToSQLOpSpec struct {
	DriverName     string `json:"driverName,omitempty"`
	DataSourceName string `json:"dataSourcename,omitempty"`
	Table          string `json:"table,omitempty"`
}

func (ToSQLOpSpec) Kind added in v0.35.0

func (*ToSQLOpSpec) ReadArgs added in v0.35.0

func (o *ToSQLOpSpec) ReadArgs(args flux.Arguments) error

type ToSQLProcedureSpec added in v0.35.0

type ToSQLProcedureSpec struct {
	plan.DefaultCost
	Spec *ToSQLOpSpec
}

func (*ToSQLProcedureSpec) Copy added in v0.35.0

func (*ToSQLProcedureSpec) Kind added in v0.35.0

type ToSQLTransformation added in v0.35.0

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

func NewToSQLTransformation added in v0.35.0

func NewToSQLTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *ToSQLProcedureSpec) (*ToSQLTransformation, error)

func (*ToSQLTransformation) Finish added in v0.35.0

func (t *ToSQLTransformation) Finish(id execute.DatasetID, err error)

func (*ToSQLTransformation) Process added in v0.35.0

func (t *ToSQLTransformation) Process(id execute.DatasetID, tbl flux.Table) (err error)

func (*ToSQLTransformation) RetractTable added in v0.35.0

func (t *ToSQLTransformation) RetractTable(id execute.DatasetID, key flux.GroupKey) error

func (*ToSQLTransformation) UpdateProcessingTime added in v0.35.0

func (t *ToSQLTransformation) UpdateProcessingTime(id execute.DatasetID, pt execute.Time) error

func (*ToSQLTransformation) UpdateWatermark added in v0.35.0

func (t *ToSQLTransformation) UpdateWatermark(id execute.DatasetID, pt execute.Time) error

Jump to

Keyboard shortcuts

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