db

package
v0.0.0-...-9ade79a Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Uri      string
	User     string
	Password string
	Path     string
	Logger   *logrus.Logger
}

type Entity

type Entity struct {
	Id          uint64       `db:"id"`
	MessageType string       `db:"message_type"`
	SpaceType   string       `db:"space_type"`
	ReceiverId  uint64       `db:"receiver_id"`
	LogData     *string      `db:"log_data,omitempty"`
	CreateTime  sql.NullTime `db:"create_time"`
}

type Repository

type Repository interface {
	UseDatabase()
	Insert(e Entity) (rowsAffected int)
	GetAll() (entities []Entity)
	GetDuplicatesJoin() (entities []Entity)
	GetDuplicatesCte() (entities []Entity)
	DeleteDuplicatesJoin() (rowsAffected int)
	DeleteDuplicatesCte() (rowsAffected int)
	Truncate() (rowsAffected int)
}

func NewRepository

func NewRepository(c Config) Repository

Jump to

Keyboard shortcuts

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