Documentation
¶
Index ¶
- type OutputFormatter
- func (f *OutputFormatter) Close(ctx context.Context, w io.Writer) error
- func (f *OutputFormatter) ContentType() string
- func (f *OutputFormatter) OutputRow(ctx context.Context, row types.Row, w io.Writer) error
- func (f *OutputFormatter) RegisterRowMiddlewares(mw *middlewares.TableProcessor) error
- func (f *OutputFormatter) RegisterTableMiddlewares(mw *middlewares.TableProcessor) error
- type OutputFormatterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OutputFormatter ¶
type OutputFormatter struct {
TableName string
UseUpsert bool
// if 0, output all rows as a single INSERT statement, otherwise make a new statement every n rows
SplitByRows int
// contains filtered or unexported fields
}
func NewOutputFormatter ¶
func NewOutputFormatter(opts ...OutputFormatterOption) *OutputFormatter
func (*OutputFormatter) ContentType ¶
func (f *OutputFormatter) ContentType() string
func (*OutputFormatter) RegisterRowMiddlewares ¶
func (f *OutputFormatter) RegisterRowMiddlewares(mw *middlewares.TableProcessor) error
func (*OutputFormatter) RegisterTableMiddlewares ¶
func (f *OutputFormatter) RegisterTableMiddlewares(mw *middlewares.TableProcessor) error
type OutputFormatterOption ¶
type OutputFormatterOption func(*OutputFormatter)
func WithSplitByRows ¶
func WithSplitByRows(splitByRows int) OutputFormatterOption
func WithTableName ¶
func WithTableName(tableName string) OutputFormatterOption
func WithUseUpsert ¶
func WithUseUpsert(useUpsert bool) OutputFormatterOption
Click to show internal directories.
Click to hide internal directories.