Documentation ¶
Index ¶
- Constants
- Variables
- func BuildConditions(equal map[string]interface{}, in map[string]interface{}) ([]string, []interface{}, error)
- func BuildIndexDDL(tableName string, indexName string, fields []string, backend types.BackendType) string
- func BuildTableSchema(params BuildTableSchemaParams) string
- func DBValueType(backend types.BackendType, valueType types.ValueType) (string, error)
- func DeserializeByValueType(i interface{}, valueType types.ValueType, backend types.BackendType) (interface{}, error)
- func DropTable(ctx context.Context, dbOpt DBOpt, tableName string) error
- func Fill(size int, elem string, sep string) string
- func GetColumnFormat(backendType types.BackendType) (string, error)
- func InsertRecordsToTable(ctx context.Context, dbOpt DBOpt, tableName string, records []interface{}, ...) error
- func InsertRecordsToTableTx(tx *sqlx.Tx, ctx context.Context, tableName string, records []interface{}, ...) error
- func IsTableNotFoundError(err error, backend types.BackendType) (bool, error)
- func LoadDataFromSource(backend types.BackendType, batchSize int) func(tx *sqlx.Tx, ctx context.Context, opt LoadDataFromSourceOpt) error
- func OfflineBatchSnapshotTableName(groupID int, revisionID int64) string
- func OfflineStreamCdcTableName(groupID int, revision int64) string
- func OfflineStreamSnapshotTableName(groupID int, revision int64) string
- func OnlineBatchTableName(revisionID int) string
- func OnlineStreamTableName(groupID int) string
- func OpenMysqlDB(host, port, user, password, database string) (*sqlx.DB, error)
- func OpenPostgresDB(host, port, user, password, database string) (*sqlx.DB, error)
- func OpenSQLite(dbFile string) (*sqlx.DB, error)
- func QuoteFn(backendType types.BackendType) func(...string) string
- func RandString(n int) string
- func ReadLine(opt ReadLineOpt) ([]interface{}, error)
- func SerializeByValue(i interface{}, backend types.BackendType) (string, error)
- func SerializeByValueType(i interface{}, valueType types.ValueType, backend types.BackendType) (interface{}, error)
- func TempTable(prefix string) string
- func ValueType(backend types.BackendType, dbValueType string) (types.ValueType, error)
- func WithTransaction(db *sqlx.DB, ctx context.Context, fn TxFn) (err error)
- type BuildTableSchemaParams
- type Column
- type ColumnList
- type DBOpt
- type LoadDataFromSourceOpt
- type ReadLineOpt
- type RowMap
- type TxFn
Constants ¶
View Source
const (
MYSQL_NO_SUCH_TABLE = 1146
)
Variables ¶
View Source
var OpenRedshiftDB = OpenPostgresDB
Functions ¶
func BuildConditions ¶
func BuildIndexDDL ¶ added in v0.0.4
func BuildTableSchema ¶ added in v0.0.4
func BuildTableSchema(params BuildTableSchemaParams) string
func DBValueType ¶ added in v0.0.4
func DeserializeByValueType ¶ added in v0.1.0
func DeserializeByValueType(i interface{}, valueType types.ValueType, backend types.BackendType) (interface{}, error)
func GetColumnFormat ¶ added in v0.0.4
func GetColumnFormat(backendType types.BackendType) (string, error)
func InsertRecordsToTable ¶ added in v0.0.2
func InsertRecordsToTableTx ¶ added in v0.0.2
func IsTableNotFoundError ¶ added in v0.0.4
func IsTableNotFoundError(err error, backend types.BackendType) (bool, error)
func LoadDataFromSource ¶ added in v0.0.4
func LoadDataFromSource(backend types.BackendType, batchSize int) func(tx *sqlx.Tx, ctx context.Context, opt LoadDataFromSourceOpt) error
Currying
func OfflineBatchSnapshotTableName ¶ added in v0.1.0
func OfflineStreamCdcTableName ¶ added in v0.0.4
func OfflineStreamSnapshotTableName ¶ added in v0.0.4
func OnlineBatchTableName ¶ added in v0.1.0
func OnlineStreamTableName ¶ added in v0.1.0
func OpenMysqlDB ¶ added in v0.0.4
func OpenPostgresDB ¶ added in v0.0.4
func RandString ¶ added in v0.0.4
func ReadLine ¶ added in v0.0.4
func ReadLine(opt ReadLineOpt) ([]interface{}, error)
ReadLine read a line from data source
func SerializeByValue ¶ added in v0.1.0
func SerializeByValue(i interface{}, backend types.BackendType) (string, error)
func SerializeByValueType ¶ added in v0.1.0
func SerializeByValueType(i interface{}, valueType types.ValueType, backend types.BackendType) (interface{}, error)
Types ¶
type BuildTableSchemaParams ¶ added in v0.1.0
type BuildTableSchemaParams struct { TableName string EntityName string HasUnixMilli bool Features types.FeatureList PrimaryKeys []string Backend types.BackendType }
type ColumnList ¶ added in v0.0.4
type ColumnList []Column
func (ColumnList) Names ¶ added in v0.0.4
func (c ColumnList) Names() []string
type DBOpt ¶ added in v0.0.4
type DBOpt struct { Backend types.BackendType // Sqlx SqlxDB *sqlx.DB // BigQuery BigQueryDB *bigquery.Client DatasetID *string // Cassandra CassandraDB *gocql.Session }
func (*DBOpt) BuildInsertQuery ¶ added in v0.0.4
type LoadDataFromSourceOpt ¶ added in v0.1.0
type LoadDataFromSourceOpt struct { Source *offline.CSVSource EntityName string TableName string Header []string Features types.FeatureList Backend types.BackendType }
type ReadLineOpt ¶ added in v0.1.0
Click to show internal directories.
Click to hide internal directories.