MCPcopy Create free account
hub / github.com/mattn/go-sqlite3 / callbackRetText

Function callbackRetText

callback.go:403–415  ·  view source on GitHub ↗
(ctx *C.sqlite3_context, v reflect.Value)

Source from the content-addressed store, hash-verified

401}
402
403func callbackRetText(ctx *C.sqlite3_context, v reflect.Value) error {
404 if v.Type().Kind() != reflect.String {
405 return fmt.Errorf("cannot convert %s to TEXT", v.Type())
406 }
407 s := v.String()
408 if i64 && len(s) > math.MaxInt32 {
409 C.sqlite3_result_error_toobig(ctx)
410 return nil
411 }
412 cstr := C.CString(s)
413 C._sqlite3_result_text(ctx, cstr, C.int(len(s)))
414 return nil
415}
416
417func callbackRetNil(ctx *C.sqlite3_context, v reflect.Value) error {
418 return nil

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected