sqlutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CDC_JOIN_QUERY = `` /* 777-byte string literal not displayed */
View Source
const EXPORT_QUERY = `` /* 934-byte string literal not displayed */
View Source
const (
	InsertBatchSize = 20
)
View Source
const JOIN_QUERY = `` /* 379-byte string literal not displayed */
View Source
const READ_JOIN_RESULT_QUERY = `` /* 438-byte string literal not displayed */
View Source
const SNAPSHOT_QUERY = `` /* 1202-byte string literal not displayed */
View Source
const UNION_ENTITY_QUERY = `
INSERT INTO {{ qt .TableName }}
{{ snapshot .SnapshotTables }}
{{ cdc .CdcTables }}
`

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(ctx context.Context, dbOpt dbutil.DBOpt, opt offline.CreateTableOpt) error

func DoExport added in v0.1.0

func DoExport(ctx context.Context, dbOpt dbutil.DBOpt, opt DoExportOpt) (*types.ExportResult, error)

func DoJoin

func DoJoin(ctx context.Context, dbOpt dbutil.DBOpt, opt DoJoinOpt) (*types.JoinResult, error)

func Export

func Export(ctx context.Context, db *sqlx.DB, opt offline.ExportOpt, backend types.BackendType) (*types.ExportResult, error)

func Import

func Import(ctx context.Context, db *sqlx.DB, opt offline.ImportOpt, loadData LoadData, backend types.BackendType) (int64, error)

func Join

func Join(ctx context.Context, db *sqlx.DB, opt offline.JoinOpt, backendType types.BackendType) (*types.JoinResult, error)

func Push

func Push(ctx context.Context, dbOpt dbutil.DBOpt, pushOpt offline.PushOpt) error

func Snapshot

func Snapshot(ctx context.Context, dbOpt dbutil.DBOpt, opt offline.SnapshotOpt) error

func SqlxTableSchema

func SqlxTableSchema(ctx context.Context, db *sqlx.DB, backend types.BackendType, rows *sqlx.Rows, opt offline.TableSchemaOpt) (*types.DataTableSchema, error)

SqlxTableSchema returns the schema of the given table.

Types

type DoExportOpt added in v0.1.0

type DoExportOpt struct {
	offline.ExportOpt
	QueryResults QueryExportResults
}

type DoJoinOpt

type DoJoinOpt struct {
	offline.JoinOpt
	QueryResults        QueryResults
	QueryTableTimeRange QueryTableTimeRange
	ReadJoinResultQuery string
}

type LoadData

type LoadData func(tx *sqlx.Tx, ctx context.Context, opt dbutil.LoadDataFromSourceOpt) error

type QueryExportResults added in v0.1.0

type QueryExportResults func(ctx context.Context, dbOpt dbutil.DBOpt, opt offline.ExportOpt, query string, args []interface{}, features types.FeatureList) (*types.ExportResult, error)

type QueryResults

type QueryResults func(ctx context.Context, dbOpt dbutil.DBOpt, query string, header dbutil.ColumnList, dropTableNames []string, backendType types.BackendType) (*types.JoinResult, error)

type QueryTableTimeRange added in v0.1.0

type QueryTableTimeRange func(ctx context.Context, dbOpt dbutil.DBOpt, tableName string) (*types.DataTableTimeRange, error)

Jump to

Keyboard shortcuts

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