Documentation
¶
Index ¶
- Constants
- func UniqueidentifierValue(val string) sql.NullString
- type MSSQL
- func (m *MSSQL) Close()
- func (m *MSSQL) Exec(sql string, args ...any) *godbv2.ExecResult
- func (m *MSSQL) Prepare(query string) (*sql.Stmt, error)
- func (m *MSSQL) QueryRow(sql string, args ...any) *godbv2.QueryResult
- func (m *MSSQL) QueryRows(sql string, args ...any) *godbv2.QueryResult
- func (m *MSSQL) QueryWithPage(sql string, page *godbv2.PageObj, args ...interface{}) *godbv2.QueryResult
- func (m *MSSQL) SetConn(conn godbv2.QueryWithContext)
- func (m *MSSQL) Transaction(t godbv2.TransactionFunc, option ...*sql.TxOptions) error
- type SQLPrinter
Constants ¶
View Source
const DriverName godbv2.DriverName = "mssql"
View Source
const EmptyUniqueidentifier = "00000000-0000-0000-0000-000000000000"
EmptyUniqueidentifier 空的uniqueidentifier值
Variables ¶
This section is empty.
Functions ¶
func UniqueidentifierValue ¶
func UniqueidentifierValue(val string) sql.NullString
UniqueidentifierValue 创建一个uniqueidentifier值,当可能是null的时候用
Types ¶
type MSSQL ¶
MSSQL 操作对象
func (*MSSQL) QueryWithPage ¶
func (m *MSSQL) QueryWithPage(sql string, page *godbv2.PageObj, args ...interface{}) *godbv2.QueryResult
func (*MSSQL) SetConn ¶
func (m *MSSQL) SetConn(conn godbv2.QueryWithContext)
func (*MSSQL) Transaction ¶
type SQLPrinter ¶
type SQLPrinter struct {
Message []string `description:"输出的内容"`
ErrMessage string `description:"输出的错误"`
// contains filtered or unexported fields
}
SQLPrinter sql服务输出的消息,MSSQL支持 使用方法:
printer := &SQLPrinter{}
res := conn.QueryRows(sql,args1,arg2,printer.ReturnMessage())
printer.Parse()
fmt.Printf("Print: %v\n",printer.Message)
fmt.Printf("Error: %s\n",printer.ErrMessage)
fmt.Printf("Rows: %d\n,res.Length())
func (*SQLPrinter) ReturnMessage ¶
func (s *SQLPrinter) ReturnMessage() *sqlexp.ReturnMessage
Click to show internal directories.
Click to hide internal directories.