test_db

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column interface {
	Name() string
	DataType() string
	Nullable() bool
	PrimaryKey() bool
}

func Bool

func Bool(name string, opts ...Option) Column

func Date

func Date(name string, opts ...Option) Column

func Text

func Text(name string, opts ...Option) Column

func Time

func Time(name string, opts ...Option) Column

func Timestamp

func Timestamp(name string, opts ...Option) Column

func Timestamptz

func Timestamptz(name string, opts ...Option) Column

func Timetz

func Timetz(name string, opts ...Option) Column

func UUID

func UUID(name string, opts ...Option) Column

type Option

type Option func(*basecolumn)

func Nullable

func Nullable() Option

func PrimaryKey

func PrimaryKey() Option

type Table

type Table struct {
	Name    string
	Columns []Column
}

func (*Table) Create

func (t *Table) Create() string

func (*Table) Drop

func (t *Table) Drop() string

type TestDB

type TestDB struct {
	Tables []Table
	// contains filtered or unexported fields
}

modeled after ts/src/testutils/db/test_db.ts

func (*TestDB) AfterAll

func (tdb *TestDB) AfterAll() error

func (*TestDB) BeforeAll

func (tdb *TestDB) BeforeAll() error

Jump to

Keyboard shortcuts

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