Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultSocket is the default socket to use DefaultSocket = "/tmp/tidb-lite-socket" DefaultConnOpts = "charset=utf8mb4" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // DataDir is the directory to save db data DataDir string Socket string Port int //Connection options pass to the database, separated with & like charset=utf8mb4&parseTime=True ConnOpts string }
func NewOptions ¶
NewOptions creates a new Options with default port
func (*Options) WithConnOpts ¶
WithConnOpts overrides default connection options
func (*Options) WithSocket ¶
WithSocket set the socket
type TiDBServer ¶
type TiDBServer struct { Cfg *config.Config Svr *server.Server Storage kv.Storage Dom *domain.Domain ConnOpts string // contains filtered or unexported fields }
TiDBServer ...
func GetTiDBServer ¶
func GetTiDBServer() (*TiDBServer, error)
GetTiDBServer returns the tidb server if it is not nil
func NewTiDBServer ¶
func NewTiDBServer(options *Options) (*TiDBServer, error)
NewTiDBServer returns a new TiDBServer
func (*TiDBServer) CloseGracefully ¶
func (t *TiDBServer) CloseGracefully()
CloseGracefully closes TiDB server gracefully.
func (*TiDBServer) CreateConn ¶
func (t *TiDBServer) CreateConn() (*sql.DB, error)
CreateConn creates a database connection.
func (*TiDBServer) GetStorage ¶
func (t *TiDBServer) GetStorage() kv.Storage
func (*TiDBServer) SetDBInfoMetaAndReload ¶
func (t *TiDBServer) SetDBInfoMetaAndReload(newDBs []*model.DBInfo) error
Click to show internal directories.
Click to hide internal directories.