easql

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 10 Imported by: 0

README

easql

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client = string
const (
	Postgres Client = "postgres"
	MySQL    Client = "mysql"
	SQLite   Client = "sqlite"
)

type ConnectConfig

type ConnectConfig struct {
	Client   Client
	Host     string
	Port     int
	Database string
	User     string
	Password string
}

type Connection

type Connection = sql.DB

type Database

type Database = gorm.DB

type Service

type Service struct {
	IsLogging bool

	Conn     *Connection
	Database *Database
	// contains filtered or unexported fields
}

func NewService

func NewService(c *ConnectConfig, sc *ServiceConfig) *Service

func (*Service) Disconnect

func (s *Service) Disconnect() error

func (*Service) GetConnect

func (s *Service) GetConnect() *Connection

func (*Service) GetDatabase

func (s *Service) GetDatabase() *Database

func (*Service) Init

func (s *Service) Init() error

func (*Service) SetConnection added in v0.0.2

func (s *Service) SetConnection(connection *Connection)

func (*Service) SetDatabase added in v0.0.2

func (s *Service) SetDatabase(db *Database)

func (*Service) SetLogger added in v0.0.2

func (s *Service) SetLogger(logger *ealogger.Entry)

func (*Service) SetTraceName added in v0.0.2

func (s *Service) SetTraceName(traceName string)

type ServiceConfig added in v0.0.2

type ServiceConfig struct {
	IsLogging  bool
	Logger     *ealogger.Logger
	LoggerMode ealogger.Mode

	TraceName string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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