push

package
v1.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJSONRowIterator

func NewJSONRowIterator(file io.ReadCloser) push.RowIterator

NewJSONRowIterator creates a new JSONRowIterator.

func NewJSONRowWriter

func NewJSONRowWriter(file io.Writer) push.RowWriter

NewJSONRowWriter creates a new JSONRowWriter.

Types

type JSONRowIterator

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

JSONRowIterator export rows to JSON format.

func (*JSONRowIterator) Close

func (re *JSONRowIterator) Close() *push.Error

Close file format.

func (*JSONRowIterator) Error

func (re *JSONRowIterator) Error() *push.Error

Error return error catch by next

func (*JSONRowIterator) Next

func (re *JSONRowIterator) Next() bool

Next try to convert next line to Row

func (*JSONRowIterator) Value

func (re *JSONRowIterator) Value() *push.Row

Value return current row

type JSONRowWriter

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

JSONRowWriter export rows to JSON format.

func (*JSONRowWriter) Write

func (rw *JSONRowWriter) Write(row push.Row) *push.Error

NextRow convert next line to Row

type MockSQLDialect

type MockSQLDialect struct {
	mock.Mock
}

MockSQLDialect is an autogenerated mock type for the SQLDialect type

func (*MockSQLDialect) ConvertValue

func (_m *MockSQLDialect) ConvertValue(_a0 push.Value) push.Value

ConvertValue provides a mock function with given fields: _a0

func (*MockSQLDialect) DisableConstraintsStatement

func (_m *MockSQLDialect) DisableConstraintsStatement(tableName string) string

DisableConstraintsStatement provides a mock function with given fields: tableName

func (*MockSQLDialect) EnableConstraintsStatement

func (_m *MockSQLDialect) EnableConstraintsStatement(tableName string) string

EnableConstraintsStatement provides a mock function with given fields: tableName

func (*MockSQLDialect) InsertStatement

func (_m *MockSQLDialect) InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string

InsertStatement provides a mock function with given fields: tableName, columns, values, primaryKeys

func (*MockSQLDialect) IsDuplicateError

func (_m *MockSQLDialect) IsDuplicateError(_a0 error) bool

IsDuplicateError provides a mock function with given fields: _a0

func (*MockSQLDialect) Placeholder

func (_m *MockSQLDialect) Placeholder(_a0 int) string

Placeholder provides a mock function with given fields: _a0

func (*MockSQLDialect) TruncateStatement

func (_m *MockSQLDialect) TruncateStatement(tableName string) string

TruncateStatement provides a mock function with given fields: tableName

func (*MockSQLDialect) UpdateStatement

func (_m *MockSQLDialect) UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, *push.Error)

UpdateStatement provides a mock function with given fields: tableName, columns, uValues, primaryKeys, pValues

type OracleDataDestinationFactory

type OracleDataDestinationFactory struct{}

OracleDataDestinationFactory exposes methods to create new Oracle extractors.

func NewOracleDataDestinationFactory

func NewOracleDataDestinationFactory() *OracleDataDestinationFactory

NewOracleDataDestinationFactory creates a new Oracle datadestination factory.

func (*OracleDataDestinationFactory) New

New return a Oracle pusher

type OracleDialect

type OracleDialect struct{}

OracleDialect inject oracle variations

func (OracleDialect) ConvertValue

func (d OracleDialect) ConvertValue(from push.Value) push.Value

ConvertValue before load

func (OracleDialect) DisableConstraintsStatement

func (d OracleDialect) DisableConstraintsStatement(tableName string) string

DisableConstraintsStatement generate statments to deactivate constraintes

func (OracleDialect) EnableConstraintsStatement

func (d OracleDialect) EnableConstraintsStatement(tableName string) string

EnableConstraintsStatement generate statments to activate constraintes

func (OracleDialect) InsertStatement

func (d OracleDialect) InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string

InsertStatement generate insert statement

func (OracleDialect) IsDuplicateError

func (d OracleDialect) IsDuplicateError(err error) bool

IsDuplicateError check if error is a duplicate error

func (OracleDialect) Placeholder

func (d OracleDialect) Placeholder(position int) string

Placeholde return the variable format for postgres

func (OracleDialect) TruncateStatement

func (d OracleDialect) TruncateStatement(tableName string) string

TruncateStatement generate statement to truncat table content

func (OracleDialect) UpdateStatement

func (d OracleDialect) UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, *push.Error)

UpdateStatement

type PostgresDataDestinationFactory

type PostgresDataDestinationFactory struct{}

PostgresDataDestinationFactory exposes methods to create new Postgres pullers.

func NewPostgresDataDestinationFactory

func NewPostgresDataDestinationFactory() *PostgresDataDestinationFactory

NewPostgresDataDestinationFactory creates a new postgres datadestination factory.

func (*PostgresDataDestinationFactory) New

New return a Postgres pusher

type PostgresDialect

type PostgresDialect struct{}

PostgresDialect inject postgres variations

func (PostgresDialect) ConvertValue

func (d PostgresDialect) ConvertValue(from push.Value) push.Value

ConvertValue before load

func (PostgresDialect) DisableConstraintsStatement

func (d PostgresDialect) DisableConstraintsStatement(tableName string) string

DisableConstraintsStatement generate statments to deactivate constraintes

func (PostgresDialect) EnableConstraintsStatement

func (d PostgresDialect) EnableConstraintsStatement(tableName string) string

EnableConstraintsStatement generate statments to activate constraintes

func (PostgresDialect) InsertStatement

func (d PostgresDialect) InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string

InsertStatement generate insert statement

func (PostgresDialect) IsDuplicateError

func (d PostgresDialect) IsDuplicateError(err error) bool

IsDuplicateError check if error is a duplicate error

func (PostgresDialect) Placeholder

func (d PostgresDialect) Placeholder(position int) string

Placeholde return the variable format for postgres

func (PostgresDialect) TruncateStatement

func (d PostgresDialect) TruncateStatement(tableName string) string

TruncateStatement generate statement to truncat table content

func (PostgresDialect) UpdateStatement

func (d PostgresDialect) UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, *push.Error)

type SQLDataDestination

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

SQLDataDestination read data from a SQL database.

func NewSQLDataDestination

func NewSQLDataDestination(url string, schema string, dialect SQLDialect) *SQLDataDestination

NewSQLDataDestination creates a new SQL datadestination.

func (*SQLDataDestination) Close

func (dd *SQLDataDestination) Close() *push.Error

Close SQL connections

func (*SQLDataDestination) Commit

func (dd *SQLDataDestination) Commit() *push.Error

Commit SQL for connection

func (*SQLDataDestination) Open

func (dd *SQLDataDestination) Open(plan push.Plan, mode push.Mode, disableConstraints bool) *push.Error

Open SQL Connection

func (*SQLDataDestination) RowWriter

func (dd *SQLDataDestination) RowWriter(table push.Table) (push.RowWriter, *push.Error)

RowWriter return SQL table writer

type SQLDialect

type SQLDialect interface {
	Placeholder(int) string
	DisableConstraintsStatement(tableName string) string
	EnableConstraintsStatement(tableName string) string
	TruncateStatement(tableName string) string
	InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string
	UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, *push.Error)
	IsDuplicateError(error) bool
	ConvertValue(push.Value) push.Value
}

SQLDialect is an interface to inject SQL variations

type SQLRowWriter

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

SQLRowWriter write data to a SQL table.

func NewSQLRowWriter

func NewSQLRowWriter(table push.Table, dd *SQLDataDestination) *SQLRowWriter

NewSQLRowWriter creates a new SQL row writer.

func (*SQLRowWriter) Write

func (rw *SQLRowWriter) Write(row push.Row) *push.Error

Write

Jump to

Keyboard shortcuts

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