db

package
v0.0.0-...-55065b5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(driverName, dataSource string) error

func Reset

func Reset(driverName, dataSource, dbName string) error

Types

type DB

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

func Open

func Open(driverName, dataSource string) (*DB, error)

func (*DB) AllPhones

func (db *DB) AllPhones() ([]Phone, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) DeletePhone

func (db *DB) DeletePhone(id int) error

func (*DB) FindPhone

func (db *DB) FindPhone(number string) (*Phone, error)

func (*DB) Seed

func (db *DB) Seed() error

func (*DB) UpdatePhone

func (db *DB) UpdatePhone(p *Phone) error

type Phone

type Phone struct {
	ID     int
	Number string
}

Phone represents the phone_numbers table in the DB

Jump to

Keyboard shortcuts

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