MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Close

Method Close

xenomint/state.go:120–138  ·  view source on GitHub ↗

Close commits any ongoing transaction if needed and closes the underlying storage.

(commit bool)

Source from the content-addressed store, hash-verified

118
119// Close commits any ongoing transaction if needed and closes the underlying storage.
120func (s *State) Close(commit bool) (err error) {
121 s.Lock()
122 defer s.Unlock()
123 if s.closed {
124 return
125 }
126 if s.handler != nil {
127 if commit {
128 s.commitHandler()
129 } else {
130 s.rollbackHandler()
131 }
132 }
133 if err = s.strg.Close(); err != nil {
134 return
135 }
136 s.closed = true
137 return
138}
139
140func buildTypeNamesFromSQLColumnTypes(types []*sql.ColumnType) (names []string) {
141 names = make([]string, len(types))

Callers

nothing calls this directly

Calls 3

commitHandlerMethod · 0.95
rollbackHandlerMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected