reform

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UsersTable = &usersTableType{
	s: parse.StructInfo{Type: "Users", SQLSchema: "", SQLName: "users", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Name", Type: "string", Column: "name"}, {Name: "Phone", Type: "string", Column: "phone"}, {Name: "Date", Type: "string", Column: "date"}, {Name: "City", Type: "string", Column: "city"}, {Name: "Country", Type: "string", Column: "country"}, {Name: "Email", Type: "string", Column: "email"}, {Name: "Coordinates", Type: "string", Column: "coordinates"}}, PKFieldIndex: 0},
	z: new(Users).Values(),
}

UsersTable represents users view or table in SQL database.

Functions

This section is empty.

Types

type UserDB

type UserDB struct {
	DB *reform.DB
}

func (*UserDB) Fetch

func (u *UserDB) Fetch(limit int) ([]Users, error)

type Users

type Users struct {
	ID          int32  `reform:"id,pk"`
	Name        string `reform:"name"`
	Phone       string `reform:"phone"`
	Date        string `reform:"date"`
	City        string `reform:"city"`
	Country     string `reform:"country"`
	Email       string `reform:"email"`
	Coordinates string `reform:"coordinates"`
}

Users represents a row in users table.

func (*Users) HasPK

func (s *Users) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*Users) PKPointer

func (s *Users) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*Users) PKValue

func (s *Users) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*Users) Pointers

func (s *Users) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*Users) SetPK

func (s *Users) SetPK(pk interface{})

SetPK sets record primary key.

func (Users) String

func (s Users) String() string

String returns a string representation of this struct or record.

func (*Users) Table

func (s *Users) Table() reform.Table

Table returns Table object for that record.

func (*Users) Values

func (s *Users) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*Users) View

func (s *Users) View() reform.View

View returns View object for that struct.

Jump to

Keyboard shortcuts

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