mysql

package
v0.0.0-...-a483330 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: MIT Imports: 4 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 {
	ConnectionURL string `json:"connectionUrl"`
}

Config provides options to establish connection to MySQL db

type MySQL

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

MySQL provides a way to work with MySQL database

func New

func New(config *Config) *MySQL

New - initialize new MySQL struct with config

func (*MySQL) Close

func (m *MySQL) Close() error

Close current MySQL connection

func (*MySQL) CreateRecord

func (m *MySQL) CreateRecord(q QueryInfo) (ok bool, err error)

CreateRecord create records by passed query

func (*MySQL) GetRecords

func (m *MySQL) GetRecords(q QueryInfo) ([]map[string]interface{}, error)

GetRecords return records from table passed in url and by query passed in body

func (*MySQL) Open

func (m *MySQL) Open() error

Open new MySQL connection using passed to New func config

type QueryInfo

type QueryInfo struct {
	Query string `json:"query"`
}

Jump to

Keyboard shortcuts

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