database

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DateTimeConverter = func(value string) reflect.Value {
	if v, err := time.Parse("2006-01-02 15:04:05", value); err == nil {
		return reflect.ValueOf(v)
	}
	return reflect.ValueOf(time.Time{})
}
View Source
var DateTimeFormat = "2006-01-02 15:04:05"

Functions

func Close

func Close()

func InitDB

func InitDB(dbType, host, user, password, dbName string, port int, prefix string, showSql bool, logLevel string)

func InitDB2

func InitDB2(dbDriver, datasource, prefix string, showSql bool, logLevel string)

func Initial

func Initial()

Types

type DateTime

type DateTime time.Time

func (DateTime) IsZero

func (t DateTime) IsZero() bool

func (DateTime) MarshalJSON

func (t DateTime) MarshalJSON() ([]byte, error)

func (*DateTime) Scan

func (t *DateTime) Scan(value interface{}) error

func (DateTime) String

func (t DateTime) String() string

////// database/sql 需要的方法

func (*DateTime) UnmarshalJSON

func (t *DateTime) UnmarshalJSON(data []byte) error

func (DateTime) Value

func (t DateTime) Value() (driver.Value, error)

type Int64 added in v0.1.7

type Int64 int64

func (Int64) MarshalJSON added in v0.1.7

func (i Int64) MarshalJSON() ([]byte, error)

///////////////////////////////////

func (Int64) String added in v0.1.8

func (i Int64) String() string

func (*Int64) UnmarshalJSON added in v0.1.7

func (i *Int64) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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