Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions sqlitex/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ type ExecOptions struct {
//
// Basic reflection on Args is used to map:
//
// integers to BindInt64
// floats to BindFloat
// []byte to BindBytes
// string to BindText
// bool to BindBool
// - integers to BindInt64
// - floats to BindFloat
// - []byte to BindBytes
// - string to BindText
// - bool to BindBool
// - untyped nil to BindNull
//
// All other kinds are printed using fmt.Sprint(v) and passed to BindText.
// All other kinds are printed using [fmt.Sprint] and passed to BindText.
Args []any

// Named is the set of named arguments to bind to the statement. Keys must
Expand All @@ -50,13 +51,14 @@ type ExecOptions struct {
//
// Basic reflection on Named is used to map:
//
// integers to BindInt64
// floats to BindFloat
// []byte to BindBytes
// string to BindText
// bool to BindBool
// - integers to BindInt64
// - floats to BindFloat
// - []byte to BindBytes
// - string to BindText
// - bool to BindBool
// - untyped nil to BindNull
//
// All other kinds are printed using fmt.Sprint(v) and passed to BindText.
// All other kinds are printed using [fmt.Sprint] and passed to BindText.
Named map[string]any

// ResultFunc is called for each result row.
Expand All @@ -76,14 +78,14 @@ type ExecOptions struct {
// query using the [sqlite.Stmt] Bind* methods. Basic reflection on args is used
// to map:
//
// integers to BindInt64
// floats to BindFloat
// []byte to BindBytes
// string to BindText
// bool to BindBool
// - integers to BindInt64
// - floats to BindFloat
// - []byte to BindBytes
// - string to BindText
// - bool to BindBool
// - untyped nil to BindNull
//
// All other kinds are printed using fmt.Sprintf("%v", v) and passed
// to BindText.
// All other kinds are printed using [fmt.Sprint] and passed to BindText.
//
// Exec is implemented using the Stmt prepare mechanism which allows
// better interactions with Go's type system and avoids pitfalls of
Expand Down