primedb

package
v0.0.0-...-bd1bc83 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const UsersTableName = "users"

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func Connect

func Connect(s Settings) (DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) UserGet

func (db *DB) UserGet(tgID int64) (User, error)

func (*DB) UserUpdate

func (db *DB) UserUpdate(u UserUpdateData) (User, error)

type Settings

type Settings struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
}

type User

type User struct {
	TgID int64  `gorm:"column:tg_user_id"`
	Lang string `gorm:"column:lang"`
}

func (User) TableName

func (User) TableName() string

type UserUpdateData

type UserUpdateData struct {
	TgID int64   `gorm:"column:tg_user_id"`
	Lang *string `gorm:"column:lang"`
}

func (UserUpdateData) TableName

func (UserUpdateData) TableName() string

Jump to

Keyboard shortcuts

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