connect

package
v0.0.0-...-adf498d Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 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 Connect

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

Connect a database connection

func NewConnection

func NewConnection(dsn *DataSourceName) (conn *Connect, err error)

NewConnection connect to a exist database

func (*Connect) Close

func (conn *Connect) Close() (err error)

Close the database connects

func (*Connect) Query

func (conn *Connect) Query(sqlStr string, args ...any) (result Results, err error)

Query the data according the sql string

type DataSourceName

type DataSourceName struct {
	Username string
	Password string
	Address  string
	Port     int
}

DataSourceName database source name

func (*DataSourceName) String

func (dsn *DataSourceName) String() string

type Result

type Result = map[string]any

type Results

type Results = []Result

Jump to

Keyboard shortcuts

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