MCPcopy
hub / github.com/jackc/pgx / Close

Method Close

stdlib/sql.go:592–605  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

590}
591
592func (s *Stmt) Close() error {
593 ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
594 defer cancel()
595
596 refCount := s.conn.psRefCounts[s.sd]
597 if refCount == 1 {
598 delete(s.conn.psRefCounts, s.sd)
599 } else {
600 s.conn.psRefCounts[s.sd]--
601 return nil
602 }
603
604 return s.conn.conn.Deallocate(ctx, s.sd.SQL)
605}
606
607func (s *Stmt) NumInput() int {
608 return len(s.sd.ParamOIDs)

Callers

nothing calls this directly

Calls 1

DeallocateMethod · 0.45

Tested by

no test coverage detected