sqldb

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDBDialectCache

func ClearDBDialectCache(db *sql.DB) bool

clear db dialect cache

func GetDBDriverName

func GetDBDriverName(db *sql.DB) string

GetDBDriverName get db driver name string of sql.db

func GetDBPlaceholder

func GetDBPlaceholder(db *sql.DB) protosql.SQLPlaceholder

GetDBPlaceholder get placeholder of sql.db

Types

type TDBDialect

type TDBDialect int
const (
	Unknown  TDBDialect = 0
	Postgres TDBDialect = 1
	Mysql    TDBDialect = 2
	SQLite   TDBDialect = 3
	Oracle   TDBDialect = 4
)

func GetDBDialect

func GetDBDialect(db *sql.DB) (dialect TDBDialect)

GetDBDialect get db dialect of sql.db

func (TDBDialect) Placeholder

func (this TDBDialect) Placeholder() protosql.SQLPlaceholder

Placeholder get placeholder of db dialect

type TDBDialectCacheItem

type TDBDialectCacheItem struct {
	DB          *sql.DB
	Placeholder protosql.SQLPlaceholder
	CacheTime   time.Time
}

func GetDBPlaceholderCache

func GetDBPlaceholderCache(db *sql.DB) (protosql.SQLPlaceholder, TDBDialectCacheItem)

GetDBPlaceholder get placeholder of sql.db

Jump to

Keyboard shortcuts

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