mysql

package
v0.0.0-...-69d094b Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mysql 提供一些使用 Go 操作 MySQL 时的帮助工具

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queryer

type Queryer interface {
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
}

type Selector

type Selector interface {
	SelectContext(ctx context.Context, dest any, query string, args ...any) error
}

type TimezoneCorrector

type TimezoneCorrector interface {
	CorrectTimezoneFromDB(in time.Time) time.Time
	CorrectTimezoneToDB(in time.Time) time.Time
}

TimezoneCorrector 根据解析后的 DB 数据, 修正一个时间所包含的时区信息

WARNING: beta use ONLY

func NewTimezoneCorrectorByQueryer

func NewTimezoneCorrectorByQueryer(ctx context.Context, queryer Queryer) (TimezoneCorrector, error)

func NewTimezoneCorrectorBySelector

func NewTimezoneCorrectorBySelector(ctx context.Context, selector Selector) (TimezoneCorrector, error)

Jump to

Keyboard shortcuts

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