table

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UsersColRecordID = "record_id"
	UsersColName     = "name"
	UsersColLastname = "lastname"
	UsersColGender   = "gender"

	UsersTableName = "users"
)

Costanti relative alla tabella users

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	RecordID int64   `json:"id" db:"record_id"`
	Name     *string `json:"name" db:"name"`
	Lastname *string `json:"lastname" db:"lastname"`
	Gender   *string `json:"gender" db:"gender"`
	// contains filtered or unexported fields
}

User - Define the users table Implements TableRecordInterface

func LoadAllUsers

func LoadAllUsers(db db.SQLConnector) ([]*User, error)

LoadAllUsers - Returns all users

func NewUser

func NewUser(db db.SQLConnector) *User

NewUser - Returns new instance of the struct with the init of TableRecord and set the flag "isNew" It's suggest to use always this to get new instance of the struct

func (User) GetPrimaryKeyName

func (u User) GetPrimaryKeyName() string

GetPrimaryKeyName - Returns primary key name

func (User) GetPrimaryKeyValue

func (u User) GetPrimaryKeyValue() int64

GetPrimaryKeyValue - Returns the value of the primary key

func (User) GetTableName

func (u User) GetTableName() string

GetTableName - Returns table name

func (User) GetTableRecord

func (u User) GetTableRecord() *record.TableRecord

GetTableRecord - Returns TableRecord instance of the User struct

Jump to

Keyboard shortcuts

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