db

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package db defines database models for Result data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotations

type Annotations map[string]string

Annotations is a custom-defined type of a gorm model field.

func (*Annotations) Scan

func (ann *Annotations) Scan(value interface{}) error

Scan resolves serialized data read from database into an Annotation. This implements the sql.Scanner interface.

func (Annotations) Value

func (ann Annotations) Value() (driver.Value, error)

Value returns the value of Annotations for database driver. This implements driver.Valuer. gorm uses this function to convert a database model's Annotation field into a type that gorm driver can write into the database.

type Record

type Record struct {
	// Result is used to create the relationship between the Result and Records
	// table. Data will not be returned here during reads. Use the foreign key
	// fields instead.
	Result     Result `gorm:"foreignKey:Parent,ResultID;references:Parent,ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Parent     string `gorm:"primaryKey;index:records_by_name,priority:1"`
	ResultID   string `gorm:"primaryKey"`
	ResultName string `gorm:"index:records_by_name,priority:2"`

	ID   string `gorm:"primaryKey"`
	Name string `gorm:"index:records_by_name,priority:3"`

	Type string
	Data []byte

	CreatedTime time.Time
	UpdatedTime time.Time

	Etag string
}

Record is the database model of a Record

type Result

type Result struct {
	Parent      string `gorm:"primaryKey;index:results_by_name,priority:1"`
	ID          string `gorm:"primaryKey"`
	Name        string `gorm:"index:results_by_name,priority:2"`
	Annotations Annotations

	CreatedTime time.Time
	UpdatedTime time.Time

	Etag string
}

Result is the database model of a Result.

func (Result) String

func (r Result) String() string

Directories

Path Synopsis
sqlite
Package sqlite provides sqlite-specific error checking.
Package sqlite provides sqlite-specific error checking.

Jump to

Keyboard shortcuts

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