db

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: MIT Imports: 3 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 {
	// contains filtered or unexported fields
}

DB db connection

func New

func New(host string, port uint16, username string, password string) (*DB, error)

New returns a db connection

func (*DB) Close

func (db *DB) Close()

Close closes connection

func (*DB) Exec

func (db *DB) Exec(sql string) (int64, error)

Exec executes a sql and return the count of affected rows

func (*DB) Open

func (db *DB) Open() error

Open opens connection Now it's only suport mysql

func (*DB) Query

func (db *DB) Query(sql string) ([]map[string]string, error)

Query returns a map contains results

Jump to

Keyboard shortcuts

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