writer

package
v0.0.0-...-80d01bc Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//UpdateTemplate = `UPDATE "%s" SET %s WHERE "%s" = :primary_val`
	UpdateTemplate = "UPDATE `%s` SET %s WHERE `%s` = :primary_val"
	//InsertTemplate = `INSERT INTO "%s" (%s) VALUES (%s)`
	InsertTemplate = "INSERT INTO `%s` (%s) VALUES (%s)"
	//DeleteTemplate = `DELETE FROM "%s" WHERE "%s" = :primary_val`
	DeleteTemplate = "DELETE FROM `%s` WHERE `%s` = :primary_val"
)

Functions

This section is empty.

Types

type ColumnDef

type ColumnDef struct {
	ColumnName  string
	BindingName string
	Value       interface{}
}

type DBCommand

type DBCommand struct {
	PipelineID uint64
	Sequence   uint64
	Reference  interface{}
	Record     *gravity_sdk_types_record.Record
	QueryStr   string
	Args       map[string]interface{}
	RecordDef  *gravity_sdk_types_record.RecordDef
	Tables     []string
}

func (*DBCommand) GetPipelineID

func (cmd *DBCommand) GetPipelineID() uint64

func (*DBCommand) GetReference

func (cmd *DBCommand) GetReference() interface{}

func (*DBCommand) GetSequence

func (cmd *DBCommand) GetSequence() uint64

func (*DBCommand) GetTables

func (cmd *DBCommand) GetTables() []string

type DatabaseInfo

type DatabaseInfo struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Secure   bool   `json:"secure"`
	Username string `json:"username"`
	Password string `json:"password"`
	DbName   string `json:"dbname"`
}

type RecordDef

type RecordDef struct {
	HasPrimary    bool
	PrimaryColumn string
	Values        map[string]interface{}
	ColumnDefs    []*ColumnDef
}

type Writer

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

func NewWriter

func NewWriter() *Writer

func (*Writer) DeleteRecord

func (writer *Writer) DeleteRecord(reference interface{}, record *gravity_sdk_types_record.Record, tables []string) error

func (*Writer) GetDefinition

func (*Writer) Init

func (writer *Writer) Init() error

func (*Writer) InsertRecord

func (writer *Writer) InsertRecord(reference interface{}, record *gravity_sdk_types_record.Record, tables []string) error

func (*Writer) ProcessData

func (writer *Writer) ProcessData(reference interface{}, record *gravity_sdk_types_record.Record, tables []string) error

func (*Writer) SetCompletionHandler

func (writer *Writer) SetCompletionHandler(fn database.CompletionHandler)

func (*Writer) Truncate

func (writer *Writer) Truncate(table string) error

func (*Writer) UpdateRecord

func (writer *Writer) UpdateRecord(reference interface{}, record *gravity_sdk_types_record.Record, tables []string) error

Jump to

Keyboard shortcuts

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