Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstWhere ¶
func FirstWhere[T any](ctx context.Context, db *gorm.DB, notFound error, where string, args ...any) (*T, error)
FirstWhere fetches a single row of T matching the provided WHERE clause. It maps gorm.ErrRecordNotFound to notFound (when non-nil) and otherwise wraps the error with a generic "failed to query <T>" prefix.
Example:
user, err := sqlite.FirstWhere[user.User](ctx, s.db.DB, ErrUserNotFound, "username = ?", username)
func IsRetryableWriteError ¶
IsRetryableWriteError reports whether a database write failed because the database was temporarily busy or timed out.
func NormalizeQuery ¶
NormalizeQuery converts mattn-style SQLite DSN options to _pragma values and drops every foreign_keys setting so callers control enforcement.
func RegisterFunctions ¶
func RegisterFunctions() error
RegisterFunctions makes normalize(text, form) available to new SQLite connections.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.