@@ -194,10 +194,12 @@ func (c *Conn) handshake() error {
194194 return nil
195195}
196196
197+ // Close directly closes the connection. Use Quit() to first send COM_QUIT to the server and then close the connection.
197198func (c * Conn ) Close () error {
198199 return c .Conn .Close ()
199200}
200201
202+ // Quit sends COM_QUIT to the server and then closes the connection. Use Close() to directly close the connection.
201203func (c * Conn ) Quit () error {
202204 if err := c .writeCommand (COM_QUIT ); err != nil {
203205 return err
@@ -375,6 +377,7 @@ func (c *Conn) Rollback() error {
375377 return errors .Trace (err )
376378}
377379
380+ // SetAttributes sets connection attributes
378381func (c * Conn ) SetAttributes (attributes map [string ]string ) {
379382 for k , v := range attributes {
380383 c .attributes [k ] = v
@@ -407,6 +410,7 @@ func (c *Conn) GetCollation() string {
407410 return c .collation
408411}
409412
413+ // FieldList uses COM_FIELD_LIST to get a list of fields from a table
410414func (c * Conn ) FieldList (table string , wildcard string ) ([]* Field , error ) {
411415 if err := c .writeCommandStrStr (COM_FIELD_LIST , table , wildcard ); err != nil {
412416 return nil , errors .Trace (err )
@@ -446,10 +450,12 @@ func (c *Conn) SetAutoCommit() error {
446450 return nil
447451}
448452
453+ // IsAutoCommit returns true if SERVER_STATUS_AUTOCOMMIT is set
449454func (c * Conn ) IsAutoCommit () bool {
450455 return c .status & SERVER_STATUS_AUTOCOMMIT > 0
451456}
452457
458+ // IsInTransaction returns true if SERVER_STATUS_IN_TRANS is set
453459func (c * Conn ) IsInTransaction () bool {
454460 return c .status & SERVER_STATUS_IN_TRANS > 0
455461}
@@ -485,6 +491,7 @@ func (c *Conn) exec(query string) (*Result, error) {
485491
486492// CapabilityString is returning a string with the names of capability flags
487493// separated by "|". Examples of capability names are CLIENT_DEPRECATE_EOF and CLIENT_PROTOCOL_41.
494+ // These are defined as constants in the mysql package.
488495func (c * Conn ) CapabilityString () string {
489496 var caps []string
490497 capability := c .capability
@@ -568,6 +575,8 @@ func (c *Conn) CapabilityString() string {
568575 return strings .Join (caps , "|" )
569576}
570577
578+ // StatusString returns a "|" separated list of status fields. Example status values are SERVER_QUERY_WAS_SLOW and SERVER_STATUS_AUTOCOMMIT.
579+ // These are defined as constants in the mysql package.
571580func (c * Conn ) StatusString () string {
572581 var stats []string
573582 status := c .status
0 commit comments