sqlutil

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CDC_JOIN_QUERY = `` /* 777-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 = `` /* 1123-byte string literal not displayed */

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(ctx context.Context, db *sqlx.DB, opt offline.CreateTableOpt, backend types.BackendType) error

func DeserializeByValueType

func DeserializeByValueType(i interface{}, valueType types.ValueType, backend types.BackendType) (interface{}, 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, backendType types.BackendType) (<-chan types.ExportRecord, <-chan error)

func Import

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

func Join

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

func JoinOneGroup

func JoinOneGroup(ctx context.Context, dbOpt dbutil.DBOpt, opt offline.JoinOneGroupOpt) ([]string, error)

func PrepareEntityRowsTable

func PrepareEntityRowsTable(ctx context.Context,
	dbOpt dbutil.DBOpt,
	entity types.Entity,
	entityRows <-chan types.EntityRow,
	valueNames []string,
) (string, error)

func PrepareJoinedTable

func PrepareJoinedTable(
	ctx context.Context,
	dbOpt dbutil.DBOpt,
	features types.FeatureList,
	entity types.Entity,
	groupName string,
	valueNames []string,
) (string, error)

func Push

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

func ReadJoinedTable

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

func Snapshot

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

func SqlxTableSchema

func SqlxTableSchema(ctx context.Context, store offline.Store, backend types.BackendType, rows *sqlx.Rows) (*types.DataTableSchema, error)

SqlxTableSchema returns the schema of the given table.

Types

type DoJoinOpt

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

type LoadData

type LoadData func(tx *sqlx.Tx, ctx context.Context, source *offline.CSVSource, tableName string, header []string, features types.FeatureList) 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 ReadJoinedTableOpt

type ReadJoinedTableOpt struct {
	EntityRowsTableName string
	TableNames          []string
	AllTableNames       []string
	FeatureMap          map[string]types.FeatureList
	ValueNames          []string
	QueryResults        QueryResults
	ReadJoinResultQuery string
	BackendType         types.BackendType
}

Jump to

Keyboard shortcuts

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