splitable

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PurgeAll

func PurgeAll() error

Types

type ISplitTableObject

type ISplitTableObject interface {
	GetRecordTime() time.Time
}

type SSplitTableSpec

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

func NewSplitTableSpec

func NewSplitTableSpec(s interface{}, name string, indexField string, dateField string, maxDuration time.Duration, maxSegments int, dbName sqlchemy.DBName) (*SSplitTableSpec, error)

func (*SSplitTableSpec) AddIndex

func (t *SSplitTableSpec) AddIndex(unique bool, cols ...string) bool

func (*SSplitTableSpec) CheckSync

func (spec *SSplitTableSpec) CheckSync() error

func (*SSplitTableSpec) ColumnSpec

func (t *SSplitTableSpec) ColumnSpec(name string) sqlchemy.IColumnSpec

func (*SSplitTableSpec) Columns

func (t *SSplitTableSpec) Columns() []sqlchemy.IColumnSpec

func (*SSplitTableSpec) DataType

func (t *SSplitTableSpec) DataType() reflect.Type

func (*SSplitTableSpec) Database

func (t *SSplitTableSpec) Database() *sqlchemy.SDatabase

func (*SSplitTableSpec) Decrement

func (t *SSplitTableSpec) Decrement(diff, target interface{}) error

func (*SSplitTableSpec) Drop

func (t *SSplitTableSpec) Drop() error

func (*SSplitTableSpec) DropForeignKeySQL

func (t *SSplitTableSpec) DropForeignKeySQL() []string

func (*SSplitTableSpec) Expression

func (t *SSplitTableSpec) Expression() string

func (*SSplitTableSpec) Fetch

func (t *SSplitTableSpec) Fetch(dt interface{}) error

func (*SSplitTableSpec) GetExtraOptions

func (t *SSplitTableSpec) GetExtraOptions() sqlchemy.TableExtraOptions

func (*SSplitTableSpec) GetTableMetaByObject

func (spec *SSplitTableSpec) GetTableMetaByObject(obj ISplitTableObject) (*STableMetadata, error)

func (*SSplitTableSpec) GetTableMetaByTime

func (spec *SSplitTableSpec) GetTableMetaByTime(recordTime time.Time) (*STableMetadata, error)

func (*SSplitTableSpec) GetTableMetas

func (spec *SSplitTableSpec) GetTableMetas() ([]STableMetadata, error)

func (*SSplitTableSpec) GetTableSpec

func (spec *SSplitTableSpec) GetTableSpec(meta STableMetadata) *sqlchemy.STableSpec

func (*SSplitTableSpec) Increment

func (t *SSplitTableSpec) Increment(diff, target interface{}) error

func (*SSplitTableSpec) Indexes

func (t *SSplitTableSpec) Indexes() []sqlchemy.STableIndex

func (*SSplitTableSpec) Insert

func (t *SSplitTableSpec) Insert(dt interface{}) error

func (*SSplitTableSpec) InsertOrUpdate

func (t *SSplitTableSpec) InsertOrUpdate(dt interface{}) error

func (*SSplitTableSpec) Instance

func (t *SSplitTableSpec) Instance() *sqlchemy.STable

func (*SSplitTableSpec) Name

func (t *SSplitTableSpec) Name() string

func (*SSplitTableSpec) PrimaryColumns

func (t *SSplitTableSpec) PrimaryColumns() []sqlchemy.IColumnSpec

func (*SSplitTableSpec) Purge

func (t *SSplitTableSpec) Purge(tables []string) ([]string, error)

func (*SSplitTableSpec) SetExtraOptions

func (t *SSplitTableSpec) SetExtraOptions(opts sqlchemy.TableExtraOptions)

func (*SSplitTableSpec) Sync

func (spec *SSplitTableSpec) Sync() error

func (*SSplitTableSpec) SyncSQL

func (spec *SSplitTableSpec) SyncSQL() []string

func (*SSplitTableSpec) Update

func (t *SSplitTableSpec) Update(dt interface{}, onUpdate func() error) (sqlchemy.UpdateDiffs, error)

type STableMetadata

type STableMetadata struct {
	Id        int64     `primary:"true" auto_increment:"true"`
	Table     string    `width:"64" charset:"ascii"`
	Start     int64     `nullable:"true"`
	End       int64     `nullable:"true"`
	Count     uint64    `nullable:"true"`
	StartDate time.Time `nullable:"true"`
	EndDate   time.Time `nullable:"true"`
	Deleted   bool      `nullable:"false"`
	DeleteAt  time.Time `nullable:"true"`
	CreatedAt time.Time `nullable:"false" created_at:"true"`
}

Jump to

Keyboard shortcuts

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