Files
sqlite3/pointer.go

15 lines
332 B
Go
Raw Normal View History

2023-11-07 00:50:43 +00:00
package sqlite3
// Pointer returns a pointer to a value
// that can be used as an argument to
// [database/sql.DB.Exec] and similar methods.
//
// https://www.sqlite.org/bindptr.html
func Pointer[T any](val T) any {
return pointer[T]{val}
}
type pointer[T any] struct{ val T }
2023-11-09 16:16:48 +00:00
func (p pointer[T]) Pointer() any { return p.val }