Addons for SQLBoiler
Generate editor classes to avoid boring column list in inserts/updates (especially if we want to process empty strings, false values, zero numbers).
apiKey, err := models.FindAPIKey(ctx, s.db, keyID)
if err != nil {
...
}
apiKey.Disabled = r.Disabled
apiKey.Title = r.Title
_, err = apiKey.Update(ctx, s.db, boil.Whitelist(models.APIKeyColumns.Disabled, models.APIKeyColumns.Title))
apiKey, err := models.FindAPIKey(ctx, s.db, keyID)
if err != nil {
...
}
_, err = apiKey.E().SetDisabled(r.Disabled).SetTitle(r.Title).Update(ctx, s.db)
apiKey, err := models.FindAPIKey(ctx, s.db, keyID)
if err != nil {
...
}
_, err = apiKey.E().
SetDisabled(r.Disabled).
SetTitle(r.Title).
Update(ctx, s.db)
The cancelled PR New "editor" helper to avoid column lists for simple inserts/updates
./sqlboiler-addons PATH_TO_MODEL_DIRECTORY