test

package
v0.0.0-...-6746792 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearQuery

func ClearQuery(s string) string

func Restore

func Restore(ctx context.Context, makeRowsNum int) error

Types

type Role

type Role struct {
	xpg.Model
	Name string `xpg:"name VARCHAR(50) NOT NULL DEFAULT ''"`
}

func (Role) Columns

func (Role) Columns() string

Columns Список полей, которые необходимо получать запросом SELECT

func (*Role) Delete

func (r *Role) Delete(ctx context.Context) error

Delete Удаление записи из БД

func (Role) PoolName

func (Role) PoolName() (name string)

func (*Role) Save

func (r *Role) Save(ctx context.Context) error

func (Role) ScanRow

func (Role) ScanRow(rows pgx.Rows) (xpg.Modeler, error)

ScanRow Реализация чтения строки из результата запроса

func (Role) Table

func (Role) Table() string

Table Возвращает название таблицы в базе данных

type User

type User struct {
	xpg.Model
	FirstName  string `xpg:"first_name VARCHAR(50) NOT NULL DEFAULT ''"`
	SecondName string `xpg:"second_name VARCHAR(50) NOT NULL DEFAULT ''"`
	LastName   string `xpg:"last_name VARCHAR(50) NOT NULL DEFAULT ''"`
	Email      string `xpg:"email VARCHAR(254) NOT NULL DEFAULT ''"`
	Phone      string `xpg:"phone VARCHAR(18) NOT NULL DEFAULT ''"`
	Role       *Role  `xpg:"role_id BIGINT NOT NULL DEFAULT 0"`
	Balance    int64  `xpg:"balance BIGINT NOT NULL DEFAULT 0"`
}

func (User) Columns

func (User) Columns() string

Columns Список полей, которые необходимо получать запросом SELECT

func (*User) Delete

func (u *User) Delete(ctx context.Context) error

Delete Удаление записи из БД

func (User) PoolName

func (User) PoolName() (name string)

func (*User) Save

func (u *User) Save(ctx context.Context) error

Save Сохранение новой/измененной структуры в БД

func (User) ScanRow

func (User) ScanRow(rows pgx.Rows) (xpg.Modeler, error)

ScanRow Реализация чтения строки из результата запроса

func (User) Table

func (User) Table() string

Table Возвращает название таблицы в базе данных

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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