pgsql

package
v0.0.0-...-d9f1a53 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Db

type Db struct {
	Pool *pgxpool.Pool
}

func OpenConnection

func OpenConnection(url string) (*Db, error)

func (*Db) AddUser

func (db *Db) AddUser(botId int64, m *model.User) (int64, error)

func (*Db) CheckComponentExist

func (db *Db) CheckComponentExist(botId int64, compId int64) (bool, error)

func (*Db) CheckUserExistByTgId

func (db *Db) CheckUserExistByTgId(botId int64, tgId int64) (bool, error)

func (*Db) CloseConnection

func (db *Db) CloseConnection()

func (*Db) Component

func (db *Db) Component(botId int64, compID int64) (*model.Component, error)

func (*Db) Components

func (db *Db) Components(botId int64, groupId int64) (map[int64]*model.ComponentData, error)

func (*Db) GetBotToken

func (db *Db) GetBotToken(userId int64, botId int64) (*string, error)

func (*Db) GetRunningBots

func (db *Db) GetRunningBots() (*[]*model.Bot, error)

func (*Db) SetUserContextByTgId

func (db *Db) SetUserContextByTgId(botId int64, userId int64, ctx *bctx.Context) error

func (*Db) SetUserStepByTgId

func (db *Db) SetUserStepByTgId(botId int64, userId int64, stepID int64) error

func (*Db) UserByTgId

func (db *Db) UserByTgId(userId int64, botId int64) (*model.User, error)

func (*Db) UserContextByTgId

func (db *Db) UserContextByTgId(botId int64, userId int64) (*bctx.Context, error)

func (*Db) UserStepByTgId

func (db *Db) UserStepByTgId(botId int64, userId int64) (int64, error)

Jump to

Keyboard shortcuts

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