dbt

package
v0.0.0-...-fa7c36c Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DurS = iota // 0: second
	DurM        // 1: minute
	DurH        // 2: hour
	DurD        // 3: day
	DurW        // 4: week
	DurO        // 5: month
	DurY        // 6: year
)

duration units

View Source
const TimeFormat = "2006-01-02 15:04:05"

TimeFormat is the underlying format of Time.String()[:19]

View Source
const TimeZero = "0000-01-01 00:00:00"

TimeZero is empty time

Variables

View Source
var DurationZero = Duration([...]int{0, DurS})

DurationZero is the zero value for Duration

Functions

func IsUUID

func IsUUID(id UUID) bool

IsUUID returns if id is a valid UUID, false if empty or invalid

Types

type Array

type Array []string

Array is a custom sql/driver type to handle list columns

func (*Array) Scan

func (t *Array) Scan(value interface{}) error

Scan implements the database/sql/driver Scanner interface

func (Array) String

func (t Array) String() string

String implements the fmt Stringer interface

func (Array) V

func (t Array) V() []string

V returns the underlying object

func (Array) Value

func (t Array) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface

type Duration

type Duration [2]int

Duration is a custom sql/driver type to handle 3-state permissions

func (*Duration) Scan

func (t *Duration) Scan(value interface{}) error

Scan - Implement the database/sql Scanner interface

func (Duration) String

func (t Duration) String() string

String implements the fmt Stringer interface

func (Duration) V

func (t Duration) V() time.Duration

V returns the underlying object

func (Duration) Value

func (t Duration) Value() (driver.Value, error)

Value - Implement the database/sql Valuer interface

type Time

type Time time.Time

Time is a custom sql/driver type to handle UTC times

func NewTime

func NewTime(s string) Time

NewTime accepts a string in TimeFormat and returns a Time. TimeZero on error.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json Marshal interface

func (*Time) Scan

func (t *Time) Scan(value interface{}) error

Scan implements the database/sql/driver Scanner interface

func (Time) String

func (t Time) String() string

String implements the fmt Stringer interface

func (Time) V

func (t Time) V() time.Time

V returns the underlying object

func (Time) Value

func (t Time) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface

type UUID

type UUID string

UUID is a custom sql/driver type to handle list columns

func NewUUID

func NewUUID() UUID

NewUUID creates a new UUID

func (*UUID) Scan

func (t *UUID) Scan(value interface{}) error

Scan implements the database/sql/driver Scanner interface

func (UUID) String

func (t UUID) String() string

String implements the fmt Stringer interface

func (UUID) V

func (t UUID) V() ulid.ULID

V returns the underlying object

func (UUID) Value

func (t UUID) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface

Jump to

Keyboard shortcuts

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