代码拉取完成,页面将自动刷新
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package server
import (
"crypto/tls"
"fmt"
"github.com/pingcap/tidb/util"
"github.com/pingcap/tidb/util/auth"
"github.com/pingcap/tidb/util/chunk"
"golang.org/x/net/context"
)
// IDriver opens IContext.
type IDriver interface {
// OpenCtx opens an IContext with connection id, client capability, collation, dbname and optionally the tls state.
OpenCtx(connID uint64, capability uint32, collation uint8, dbname string, tlsState *tls.ConnectionState) (QueryCtx, error)
}
// QueryCtx is the interface to execute command.
type QueryCtx interface {
// Status returns server status code.
Status() uint16
// LastInsertID returns last inserted ID.
LastInsertID() uint64
// AffectedRows returns affected rows of last executed command.
AffectedRows() uint64
// Value returns the value associated with this context for key.
Value(key fmt.Stringer) interface{}
// SetValue saves a value associated with this context for key.
SetValue(key fmt.Stringer, value interface{})
// CommitTxn commits the transaction operations.
CommitTxn(ctx context.Context) error
// RollbackTxn undoes the transaction operations.
RollbackTxn() error
// WarningCount returns warning count of last executed command.
WarningCount() uint16
// CurrentDB returns current DB.
CurrentDB() string
// Execute executes a SQL statement.
Execute(ctx context.Context, sql string) ([]ResultSet, error)
// SetClientCapability sets client capability flags
SetClientCapability(uint32)
// Prepare prepares a statement.
Prepare(sql string) (statement PreparedStatement, columns, params []*ColumnInfo, err error)
// GetStatement gets PreparedStatement by statement ID.
GetStatement(stmtID int) PreparedStatement
// FieldList returns columns of a table.
FieldList(tableName string) (columns []*ColumnInfo, err error)
// Close closes the QueryCtx.
Close() error
// Auth verifies user's authentication.
Auth(user *auth.UserIdentity, auth []byte, salt []byte) bool
// ShowProcess shows the information about the session.
ShowProcess() util.ProcessInfo
SetSessionManager(util.SessionManager)
}
// PreparedStatement is the interface to use a prepared statement.
type PreparedStatement interface {
// ID returns statement ID
ID() int
// Execute executes the statement.
Execute(context.Context, ...interface{}) (ResultSet, error)
// AppendParam appends parameter to the statement.
AppendParam(paramID int, data []byte) error
// NumParams returns number of parameters.
NumParams() int
// BoundParams returns bound parameters.
BoundParams() [][]byte
// SetParamsType sets type for parameters.
SetParamsType([]byte)
// GetParamsType returns the type for parameters.
GetParamsType() []byte
// StoreResultSet stores ResultSet for subsequent stmt fetching
StoreResultSet(rs ResultSet)
// GetResultSet gets ResultSet associated this statement
GetResultSet() ResultSet
// Reset removes all bound parameters.
Reset()
// Close closes the statement.
Close() error
}
// ResultSet is the result set of an query.
type ResultSet interface {
Columns() []*ColumnInfo
NewChunk() *chunk.Chunk
Next(context.Context, *chunk.Chunk) error
StoreFetchedRows(rows []chunk.Row)
GetFetchedRows() []chunk.Row
Close() error
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。