MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / GetUint

Method GetUint

IceFireDB-SQLite/pkg/mysql/mysql/resultset.go:117–157  ·  view source on GitHub ↗
(row, column int)

Source from the content-addressed store, hash-verified

115}
116
117func (r *Resultset) GetUint(row, column int) (uint64, error) {
118 d, err := r.GetValue(row, column)
119 if err != nil {
120 return 0, err
121 }
122
123 switch v := d.(type) {
124 case int:
125 return uint64(v), nil
126 case int8:
127 return uint64(v), nil
128 case int16:
129 return uint64(v), nil
130 case int32:
131 return uint64(v), nil
132 case int64:
133 return uint64(v), nil
134 case uint:
135 return uint64(v), nil
136 case uint8:
137 return uint64(v), nil
138 case uint16:
139 return uint64(v), nil
140 case uint32:
141 return uint64(v), nil
142 case uint64:
143 return v, nil
144 case float32:
145 return uint64(v), nil
146 case float64:
147 return uint64(v), nil
148 case string:
149 return strconv.ParseUint(v, 10, 64)
150 case []byte:
151 return strconv.ParseUint(string(v), 10, 64)
152 case nil:
153 return 0, nil
154 default:
155 return 0, errors.Errorf("data type is %T", v)
156 }
157}
158
159func (r *Resultset) GetUintByName(row int, name string) (uint64, error) {
160 if column, err := r.NameIndex(name); err != nil {

Callers 2

GetUintByNameMethod · 0.95
GetIntMethod · 0.95

Calls 1

GetValueMethod · 0.95

Tested by

no test coverage detected