server

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type            string `json:"type,omitempty"`     // 数据库类型
	Host            string `json:"host,omitempty"`     // 数据库地址
	Port            int    `json:"port,omitempty"`     // 数据库端口
	Database        string `json:"database,omitempty"` // 数据库名 //目前用这个
	DbName          string `json:"dbName,omitempty"`   // 数据库名
	Username        string `json:"username,omitempty"`
	Password        string `json:"password,omitempty"`
	OdbcDsn         string `json:"odbcDsn,omitempty"`
	OdbcDialectName string `json:"odbcDialectName,omitempty"`

	Schema string `json:"schema,omitempty"`
	//CaseSensitive bool   `json:"caseSensitive,omitempty"` //  大小写敏感
	Sid          string `json:"sid,omitempty"`
	MaxIdleConn  int    `json:"maxIdleConn,omitempty"`
	MaxOpenConn  int    `json:"maxOpenConn,omitempty"`
	DatabasePath string `json:"databasePath,omitempty"`
}

数据库配置

type DB

type DB struct {
	Db  *sql.DB
	Dia dialect.Dialect
}

func NewDBWithConfig

func NewDBWithConfig(config *Config) (sdb *DB, err error)

通过config 初始化一个server.DB

Jump to

Keyboard shortcuts

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