storage

package
v0.0.0-...-9c44629 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateCell = "create"
	UpdateCell = "update"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolCell

type BoolCell struct {
	ID       uuid.UUID `gorm:"column:id;primary_key"`
	RecordID uuid.UUID `gorm:"column:record_id"`
	Key      string    `gorm:"column:key"`
	Value    bool      `gorm:"column:value;"`
}

func (*BoolCell) BeforeCreate

func (*BoolCell) BeforeCreate(scope *gorm.Scope) error

type CellStorage

type CellStorage interface {
	// contains filtered or unexported methods
}

type DateCell

type DateCell struct {
	ID       uuid.UUID `gorm:"column:id;primary_key"`
	RecordID uuid.UUID `gorm:"column:record_id"`
	Key      string    `gorm:"column:key"`
	Value    time.Time `gorm:"column:value"`
}

func (*DateCell) BeforeCreate

func (*DateCell) BeforeCreate(scope *gorm.Scope) error

type IntCell

type IntCell struct {
	ID       uuid.UUID `gorm:"column:id;primary_key"`
	RecordID uuid.UUID `gorm:"column:record_id"`
	Key      string    `gorm:"column:key"`
	Value    int64     `gorm:"column:value;type:integer"`
}

func (*IntCell) BeforeCreate

func (*IntCell) BeforeCreate(scope *gorm.Scope) error

type NumberCell

type NumberCell struct {
	ID       uuid.UUID `gorm:"column:id;primary_key"`
	RecordID uuid.UUID `gorm:"column:record_id"`
	Key      string    `gorm:"column:key"`
	Value    float64   `gorm:"column:value;"`
}

func (*NumberCell) BeforeCreate

func (*NumberCell) BeforeCreate(scope *gorm.Scope) error

type SQLStorage

type SQLStorage struct {
	DB database.DBEngine `inject:"database"`
}

func NewStorage

func NewStorage() *SQLStorage

func (SQLStorage) GetSchema

func (p SQLStorage) GetSchema(id uuid.UUID) (*model.Schema, error)

func (SQLStorage) UpdateRecord

func (p SQLStorage) UpdateRecord(schema model.Schema, record *model.Record) (*model.Record, error)

func (SQLStorage) WriteRecord

func (p SQLStorage) WriteRecord(schema model.Schema, record *model.Record) (*model.Record, error)

func (SQLStorage) WriteSchema

func (p SQLStorage) WriteSchema(schema *model.Schema) error

type StringCell

type StringCell struct {
	ID       uuid.UUID `gorm:"column:id;primary_key"`
	RecordID uuid.UUID `gorm:"column:record_id"`
	Key      string    `gorm:"column:key"`
	Value    string    `gorm:"column:value;"`
}

func (*StringCell) BeforeCreate

func (*StringCell) BeforeCreate(scope *gorm.Scope) error

Jump to

Keyboard shortcuts

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