refactor: rename Batch to Partition across pipeline
Rename internal types and channels from Batch to Partition for consistency with the data model.
This commit is contained in:
70
internal/app/models/colum-type.go
Normal file
70
internal/app/models/colum-type.go
Normal file
@@ -0,0 +1,70 @@
|
||||
package models
|
||||
|
||||
type ColumnType struct {
|
||||
name string
|
||||
|
||||
hasMaxLength bool
|
||||
hasPrecisionScale bool
|
||||
|
||||
userType string
|
||||
systemType string
|
||||
unifiedType string
|
||||
nullable bool
|
||||
maxLength int64
|
||||
precision int64
|
||||
scale int64
|
||||
}
|
||||
|
||||
func (c *ColumnType) Name() string {
|
||||
return c.name
|
||||
}
|
||||
|
||||
func (c *ColumnType) UserType() string {
|
||||
return c.userType
|
||||
}
|
||||
|
||||
func (c *ColumnType) SystemType() string {
|
||||
return c.systemType
|
||||
}
|
||||
|
||||
func (c *ColumnType) Length() (length int64, ok bool) {
|
||||
return c.maxLength, c.hasMaxLength
|
||||
}
|
||||
|
||||
func (c *ColumnType) DecimalSize() (precision, scale int64, ok bool) {
|
||||
return c.precision, c.scale, c.hasPrecisionScale
|
||||
}
|
||||
|
||||
func (c *ColumnType) Nullable() bool {
|
||||
return c.nullable
|
||||
}
|
||||
|
||||
func (c *ColumnType) Type() string {
|
||||
return c.unifiedType
|
||||
}
|
||||
|
||||
func NewColumnType(
|
||||
name string,
|
||||
hasMaxLength bool,
|
||||
hasPrecisionScale bool,
|
||||
userType string,
|
||||
systemType string,
|
||||
unifiedType string,
|
||||
nullable bool,
|
||||
maxLength int64,
|
||||
precision int64,
|
||||
scale int64,
|
||||
) ColumnType {
|
||||
return ColumnType{
|
||||
name,
|
||||
hasMaxLength,
|
||||
hasPrecisionScale,
|
||||
userType,
|
||||
systemType,
|
||||
unifiedType,
|
||||
nullable,
|
||||
maxLength,
|
||||
precision,
|
||||
scale,
|
||||
}
|
||||
}
|
||||
22
internal/app/models/main.go
Normal file
22
internal/app/models/main.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type UnknownRowValues = []any
|
||||
|
||||
type Batch struct {
|
||||
Id uuid.UUID
|
||||
PartitionId uuid.UUID
|
||||
Data []UnknownRowValues
|
||||
RetryCounter int
|
||||
}
|
||||
|
||||
type Partition struct {
|
||||
Id uuid.UUID
|
||||
ParentId uuid.UUID
|
||||
LowerLimit int64
|
||||
UpperLimit int64
|
||||
IsLowerLimitInclusive bool
|
||||
ShouldUseRange bool
|
||||
RetryCounter int
|
||||
}
|
||||
Reference in New Issue
Block a user