table

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: MIT Imports: 5 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 {
	*record.TableRecord
	RecordID int64       `json:"id"       db:"record_id"`
	Name     null.String `json:"name"     db:"name"`
	Lastname null.String `json:"lastname" db:"lastname"`
	Gender   null.String `json:"gender"   db:"gender"`
}

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) 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

func (User) Map added in v1.5.1

func (u User) Map() dto.DTO

Map - Implements Mappable interface

Jump to

Keyboard shortcuts

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