Documentation
¶
Index ¶
- Constants
- func BoolToInt(b bool) int64
- func FloatOrZero(v sql.NullFloat64) float64
- func Int64OrZero(v sql.NullInt64) int64
- func IsUniqueViolation(err error) bool
- func Migrate(ctx context.Context, db *sql.DB, dir fs.FS) error
- func NullJoined(xs []string) sql.NullString
- func NullableFloat(v float64) sql.NullFloat64
- func RegisterTracedDriver(tr *Tracer)
- type Tracer
Constants ¶
View Source
const TracedDriverName = "sqlite3-traced"
Variables ¶
This section is empty.
Functions ¶
func FloatOrZero ¶
func FloatOrZero(v sql.NullFloat64) float64
FloatOrZero returns the float64 value of a sql.NullFloat64 or zero if it's null.
func Int64OrZero ¶
Int64OrZero returns the int64 value of a sql.NullInt64 or zero if it's null.
func IsUniqueViolation ¶
IsUniqueViolation returns true if the error is a SQLite UNIQUE constraint violation.
func NullJoined ¶
func NullJoined(xs []string) sql.NullString
NullJoined returns a NullString by joining xs with commas. Returns an invalid NullString if xs is empty.
func NullableFloat ¶
func NullableFloat(v float64) sql.NullFloat64
func RegisterTracedDriver ¶
func RegisterTracedDriver(tr *Tracer)
Types ¶
Click to show internal directories.
Click to hide internal directories.